checkout: support checking out into a new working directory
"git checkout --to" sets up a new working directory with a .git file pointing to $GIT_DIR/worktrees/<id>. It then executes "git checkout" again on the new worktree with the same arguments except "--to" is taken out. The second checkout execution, which is not contaminated with any info from the current repository, will actually check out and everything that normal "git checkout" does. Helped-by: Marc Branchaud <marcnarc@xiplink.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
91aacda85a
commit
529fef20cf
2
path.c
2
path.c
@ -92,7 +92,7 @@ static void replace_dir(struct strbuf *buf, int len, const char *newdir)
|
||||
|
||||
static const char *common_list[] = {
|
||||
"/branches", "/hooks", "/info", "/logs", "/lost-found", "/modules",
|
||||
"/objects", "/refs", "/remotes", "/rr-cache", "/svn",
|
||||
"/objects", "/refs", "/remotes", "/worktrees", "/rr-cache", "/svn",
|
||||
"config", "gc.pid", "packed-refs", "shallow",
|
||||
NULL
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user