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 <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Denton Liu committed
Apr 20, 2020 at 04:54 UTC
085ba9b5dc8c39113f26c2c7ce4a17f3953948af
1 file changed
+4
-4
t/t6030-bisect-porcelain.sh
+4
-4
@@ -148,7 +148,7 @@ test_expect_success 'bisect start: no ".git/BISECT_START" created if junk rev' '
148
test_must_fail git bisect start $HASH4 foo -- &&
149
git branch > branch.output &&
150
grep "* other" branch.output > /dev/null &&
151
- test_must_fail test -e .git/BISECT_START
151
+ test_path_is_missing .git/BISECT_START
152
'
153
154
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' '
166
test_must_fail git bisect start $HASH1 $HASH4 -- &&
167
git branch > branch.output &&
168
grep "* other" branch.output > /dev/null &&
169
- test_must_fail test -e .git/BISECT_START
169
+ test_path_is_missing .git/BISECT_START
170
'
171
172
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' '
175
git branch &&
176
git branch > branch.output &&
177
grep "* other" branch.output > /dev/null &&
178
- test_must_fail test -e .git/BISECT_START &&
178
+ test_path_is_missing .git/BISECT_START &&
179
test -z "$(git for-each-ref "refs/bisect/*")" &&
180
git checkout HEAD hello
181
'
@@ -485,7 +485,7 @@ test_expect_success 'optimized merge base checks' '
485
git bisect bad &&
486
git bisect good "$A_HASH" > my_bisect_log4.txt &&
487
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"
489
'
490
491
# This creates another side branch called "parallel" with some files