Skip to content

Commit d6c196a

Browse files
committed
Merge branch 'nd/fixup-linked-gitdir' into maint
The code in "multiple-worktree" support that attempted to recover from an inconsistent state updated an incorrect file. * nd/fixup-linked-gitdir: setup: update the right file in multiple checkouts
2 parents e654e3b + 82fde87 commit d6c196a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

setup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,9 @@ static void update_linked_gitdir(const char *gitfile, const char *gitdir)
402402
struct strbuf path = STRBUF_INIT;
403403
struct stat st;
404404

405-
strbuf_addf(&path, "%s/gitfile", gitdir);
405+
strbuf_addf(&path, "%s/gitdir", gitdir);
406406
if (stat(path.buf, &st) || st.st_mtime + 24 * 3600 < time(NULL))
407-
write_file(path.buf, 0, "%s\n", gitfile);
407+
write_file(path.buf, 1, "%s\n", gitfile);
408408
strbuf_release(&path);
409409
}
410410

0 commit comments

Comments
 (0)