Skip to content

Commit

Permalink
Merge branch 'nd/fixup-linked-gitdir'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Junio C Hamano committed Sep 1, 2015
2 parents 1616360 + 82fde87 commit 91d5469
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 91d5469

Please sign in to comment.