setup: update the right file in multiple checkouts
[gitweb.git] / setup.c
diff --git a/setup.c b/setup.c
index 82c0cc2a13bfeae3ec364dce2438fb4c67e46a35..465b42a1d7aecc3991c9dd2c592d8fa164ba545e 100644 (file)
--- 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);
 }