Skip to content

Commit c38f0a6

Browse files
committed
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>
1 parent 5b6bb18 commit c38f0a6

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

t/t1020-subdirectory.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,7 @@ test_expect_success 'no file/rev ambiguity check inside a bare repo (explicit GI
177177
test_expect_success 'no file/rev ambiguity check inside a bare repo' '
178178
test_when_finished "rm -fr foo.git" &&
179179
git clone -s --bare .git foo.git &&
180-
(
181-
cd foo.git &&
182-
git show -s HEAD
183-
)
180+
git --git-dir=foo.git show -s HEAD
184181
'
185182

186183
test_expect_success SYMLINKS 'detection should not be fooled by a symlink' '

0 commit comments

Comments
 (0)