Skip to content

Commit 2f507db

Browse files
committed
t0001: replace cd+git config with --git-dir in check_config
To prepare for `safe.bareRepository` defaulting to `explicit` (see 8d1a744), replace `cd <dir> && git config` with `git --git-dir=<dir> config` so the helper does not rely on implicit bare repository discovery. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 2c1db4e commit 2f507db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

t/t0001-init.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ check_config () {
2020
return 1
2121
fi
2222

23-
bare=$(cd "$1" && git config --bool core.bare)
24-
worktree=$(cd "$1" && git config core.worktree) ||
23+
bare=$(git --git-dir="$1" config --bool core.bare)
24+
worktree=$(git --git-dir="$1" config core.worktree) ||
2525
worktree=unset
2626

2727
test "$bare" = "$2" && test "$worktree" = "$3" || {

0 commit comments

Comments
 (0)