From ecefd7ea3fb5b0321317786648bb912143c037cd Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 2 Apr 2026 14:33:11 +0000 Subject: [PATCH] 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 Signed-off-by: Junio C Hamano --- t/t1020-subdirectory.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/t/t1020-subdirectory.sh b/t/t1020-subdirectory.sh index 9fdbb2af80..20d2d306fe 100755 --- a/t/t1020-subdirectory.sh +++ b/t/t1020-subdirectory.sh @@ -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' '