[PATCH v2 02/17] t0001: replace `cd`+`git` with `git --git-dir` in `check_config`
- From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Apr 4, 2026, 19:49 UTC
- Message-ID
- <78744602fb33978a9f674f5f9860c58e7734d2e8.1775332197.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.2076.v2.git.1775332197.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>
To prepare for `safe.bareRepository` defaulting to `explicit` (see 8d1a7448206e), 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> --- t/t0001-init.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t0001-init.sh b/t/t0001-init.sh index 6bd0a15dac..db2bf1001f 100755 --- a/t/t0001-init.sh +++ b/t/t0001-init.sh @@ -20,8 +20,8 @@ check_config () { return 1 fi - bare=$(cd "$1" && git config --bool core.bare) - worktree=$(cd "$1" && git config core.worktree) || + bare=$(git --git-dir="$1" config --bool core.bare) + worktree=$(git --git-dir="$1" config core.worktree) || worktree=unset test "$bare" = "$2" && test "$worktree" = "$3" || {
-- gitgitgadget