From: Junio C Hamano Date: Tue, 1 Sep 2015 23:31:06 +0000 (-0700) Subject: Merge branch 'nd/fixup-linked-gitdir' X-Git-Tag: v2.6.0-rc0~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=91d54694a4e1da804063ce64b9757d5d3148e6ad;p=thirdparty%2Fgit.git 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 --- 91d54694a4e1da804063ce64b9757d5d3148e6ad diff --cc setup.c index a206781d58,465b42a1d7..a17c51e61d --- a/setup.c +++ b/setup.c @@@ -402,9 -402,9 +402,9 @@@ static void update_linked_gitdir(const 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, 1, "%s\n", gitfile); ++ write_file(path.buf, "%s", gitfile); strbuf_release(&path); }