summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-09-03 19:17:53 -0700
committerJunio C Hamano <gitster@pobox.com>2015-09-03 19:17:53 -0700
commitd6c196abfd992a884a2e1ae1275b2abfac6f6d76 (patch)
tree19b50a61f2bd10c8f4a0c666a15a49ef664d424b
parente654e3b574bf1e4cc7556c2f01188eaf41271901 (diff)
parent82fde87ff3be8d10854df18964e5816417a1d7cf (diff)
downloadgit-d6c196abfd992a884a2e1ae1275b2abfac6f6d76.tar.gz
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
-rw-r--r--setup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/setup.c b/setup.c
index 82c0cc2a13..465b42a1d7 100644
--- a/setup.c
+++ b/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);
}