summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-12-22 12:18:00 -0800
committerJunio C Hamano <gitster@pobox.com>2014-12-22 12:18:00 -0800
commite524fb497a0259cee4559f60d815218fc01ac466 (patch)
treeecfbe98babed896bf7b40bce00e191507afc3ec0
parent0b5c641490b11d887ec147b7acbe6f147bce6905 (diff)
parent1f32ecffd864ea5b339883f94463b0b69f4aeb35 (diff)
downloadgit-e524fb497a0259cee4559f60d815218fc01ac466.tar.gz
Merge branch 'mh/config-flip-xbit-back-after-checking' into maint
"git init" (hence "git clone") initialized the per-repository configuration file .git/config with x-bit by mistake. * mh/config-flip-xbit-back-after-checking: create_default_files(): don't set u+x bit on $GIT_DIR/config
-rw-r--r--builtin/init-db.c3
-rwxr-xr-xt/t0001-init.sh7
2 files changed, 9 insertions, 1 deletions
diff --git a/builtin/init-db.c b/builtin/init-db.c
index 587a5055ed..aab44d2e45 100644
--- a/builtin/init-db.c
+++ b/builtin/init-db.c
@@ -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");
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index e62c0ffbc2..7de8d85ee8 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -12,6 +12,13 @@ check_config () {
echo "expected a directory $1, a file $1/config and $1/refs"
return 1
fi
+
+ if test_have_prereq POSIXPERM && test -x "$1/config"
+ then
+ echo "$1/config is executable?"
+ return 1
+ fi
+
bare=$(cd "$1" && git config --bool core.bare)
worktree=$(cd "$1" && git config core.worktree) ||
worktree=unset