Skip to content

Commit 085ba9b

Browse files
Denton-Lgitster
authored andcommitted
t6030: use test_path_is_missing()
The test_must_fail() function should only be used for git commands since we should assume that external commands work sanely. Replace `test_must_fail test -e` with `test_path_is_missing`. Signed-off-by: Denton Liu <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 048abe1 commit 085ba9b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

t/t6030-bisect-porcelain.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ test_expect_success 'bisect start: no ".git/BISECT_START" created if junk rev' '
148148
test_must_fail git bisect start $HASH4 foo -- &&
149149
git branch > branch.output &&
150150
grep "* other" branch.output > /dev/null &&
151-
test_must_fail test -e .git/BISECT_START
151+
test_path_is_missing .git/BISECT_START
152152
'
153153

154154
test_expect_success 'bisect start: existing ".git/BISECT_START" not modified if junk rev' '
@@ -166,7 +166,7 @@ test_expect_success 'bisect start: no ".git/BISECT_START" if mistaken rev' '
166166
test_must_fail git bisect start $HASH1 $HASH4 -- &&
167167
git branch > branch.output &&
168168
grep "* other" branch.output > /dev/null &&
169-
test_must_fail test -e .git/BISECT_START
169+
test_path_is_missing .git/BISECT_START
170170
'
171171

172172
test_expect_success 'bisect start: no ".git/BISECT_START" if checkout error' '
@@ -175,7 +175,7 @@ test_expect_success 'bisect start: no ".git/BISECT_START" if checkout error' '
175175
git branch &&
176176
git branch > branch.output &&
177177
grep "* other" branch.output > /dev/null &&
178-
test_must_fail test -e .git/BISECT_START &&
178+
test_path_is_missing .git/BISECT_START &&
179179
test -z "$(git for-each-ref "refs/bisect/*")" &&
180180
git checkout HEAD hello
181181
'
@@ -485,7 +485,7 @@ test_expect_success 'optimized merge base checks' '
485485
git bisect bad &&
486486
git bisect good "$A_HASH" > my_bisect_log4.txt &&
487487
test_i18ngrep "merge base must be tested" my_bisect_log4.txt &&
488-
test_must_fail test -f ".git/BISECT_ANCESTORS_OK"
488+
test_path_is_missing ".git/BISECT_ANCESTORS_OK"
489489
'
490490

491491
# This creates another side branch called "parallel" with some files

0 commit comments

Comments
 (0)