Merge branch 'nd/fixup-linked-gitdir'

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:
Junio C Hamano 2015-09-01 16:31:06 -07:00
commit 91d54694a4

View file

@ -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_gently(path.buf, "%s", gitfile);
write_file(path.buf, "%s", gitfile);
strbuf_release(&path);
}