]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/init-db.c
Merge branch 'jk/read-packed-refs-without-path-max' into maint
[thirdparty/git.git] / builtin / init-db.c
index 587a5055ed677c3541c85101d944ffb0a19b1962..aab44d2e451b1b6a2c764a5d62464ae690ab5566 100644 (file)
@@ -254,7 +254,8 @@ static int create_default_files(const char *template_path)
                struct stat st2;
                filemode = (!chmod(path, st1.st_mode ^ S_IXUSR) &&
                                !lstat(path, &st2) &&
-                               st1.st_mode != st2.st_mode);
+                               st1.st_mode != st2.st_mode &&
+                               !chmod(path, st1.st_mode));
        }
        git_config_set("core.filemode", filemode ? "true" : "false");