summaryrefslogtreecommitdiff
path: root/t/t0001-init.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2014-03-20 23:15:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-03-21 21:24:40 (GMT)
commit3cc6a6f0f7519733deeebe17d7a19a53e9c02028 (patch)
treec5275731de7191529cd82e6faffcb2fbd7ae9edd /t/t0001-init.sh
parent221bf985063737240124fe15c328cd125e9d048e (diff)
downloadgit-3cc6a6f0f7519733deeebe17d7a19a53e9c02028.zip
git-3cc6a6f0f7519733deeebe17d7a19a53e9c02028.tar.gz
git-3cc6a6f0f7519733deeebe17d7a19a53e9c02028.tar.bz2
t: stop using GIT_CONFIG to cross repo boundaries
Some tests want to check or set config in another repository. E.g., t1000 creates repositories and makes sure that their core.bare and core.worktree settings are what we expect. We can do this with: GIT_CONFIG=$repo/.git/config git config ... but it better shows the intent to just enter the repository and let "git config" do the normal lookups: (cd $repo && git config ...) In theory, this would cause us to use an extra subshell, but in all such cases, we are actually already in a subshell. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0001-init.sh')
-rwxr-xr-xt/t0001-init.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index ddc8160..9b05fdf 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -12,8 +12,8 @@ check_config () {
echo "expected a directory $1, a file $1/config and $1/refs"
return 1
fi
- bare=$(GIT_CONFIG="$1/config" git config --bool core.bare)
- worktree=$(GIT_CONFIG="$1/config" git config core.worktree) ||
+ bare=$(cd "$1" && git config --bool core.bare)
+ worktree=$(cd "$1" && git config core.worktree) ||
worktree=unset
test "$bare" = "$2" && test "$worktree" = "$3" || {