t1020: use --git-dir instead of subshell for bare repo

Replace an unnecessarily complex subshell pattern with a much simpler
`--git-dir`-based one. The latter is not only simpler, it also no
longer relies on implicit bare repo discovery, which would fail with
`safe.bareRepository=explicit`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Johannes Schindelin
2026-04-02 14:33:11 +00:00
committed by Junio C Hamano
parent ca053477d9
commit ecefd7ea3f

View File

@@ -177,10 +177,7 @@ test_expect_success 'no file/rev ambiguity check inside a bare repo (explicit GI
test_expect_success 'no file/rev ambiguity check inside a bare repo' '
test_when_finished "rm -fr foo.git" &&
git clone -s --bare .git foo.git &&
(
cd foo.git &&
git show -s HEAD
)
git --git-dir=foo.git show -s HEAD
'
test_expect_success SYMLINKS 'detection should not be fooled by a symlink' '