mirror of
https://github.com/git/git.git
synced 2024-11-01 06:47:52 +01:00
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
This commit is contained in:
commit
d6c196abfd
1 changed files with 2 additions and 2 deletions
4
setup.c
4
setup.c
|
@ -402,9 +402,9 @@ static void update_linked_gitdir(const char *gitfile, const char *gitdir)
|
|||
struct strbuf path = STRBUF_INIT;
|
||||
struct stat st;
|
||||
|
||||
strbuf_addf(&path, "%s/gitfile", gitdir);
|
||||
strbuf_addf(&path, "%s/gitdir", gitdir);
|
||||
if (stat(path.buf, &st) || st.st_mtime + 24 * 3600 < time(NULL))
|
||||
write_file(path.buf, 0, "%s\n", gitfile);
|
||||
write_file(path.buf, 1, "%s\n", gitfile);
|
||||
strbuf_release(&path);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue