Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
init-db: improve the filemode trustability check
[gitweb.git]
/
builtin
/
init-db.c
diff --git
a/builtin/init-db.c
b/builtin/init-db.c
index a6d58fde49e30ffb49655829d5d443038cd87c04..1e0749d5bea7d117dbdfde051bd42faf2e259e96 100644
(file)
--- a/
builtin/init-db.c
+++ b/
builtin/init-db.c
@@
-256,6
+256,8
@@
static int create_default_files(const char *template_path)
!lstat(path, &st2) &&
st1.st_mode != st2.st_mode &&
!chmod(path, st1.st_mode));
+ if (filemode && !reinit && (st1.st_mode & S_IXUSR))
+ filemode = 0;
}
git_config_set("core.filemode", filemode ? "true" : "false");