Skip to content

Commit 62d58cd

Browse files
Denton-Lgitster
authored andcommitted
t1409: 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 -f` with `test_path_is_missing` since we expect these paths to not exist. Signed-off-by: Denton Liu <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b87b02c commit 62d58cd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

t/t1409-avoid-packing-refs.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ test_expect_success 'setup' '
2727
'
2828

2929
test_expect_success 'do not create packed-refs file gratuitously' '
30-
test_must_fail test -f .git/packed-refs &&
30+
test_path_is_missing .git/packed-refs &&
3131
git update-ref refs/heads/foo $A &&
32-
test_must_fail test -f .git/packed-refs &&
32+
test_path_is_missing .git/packed-refs &&
3333
git update-ref refs/heads/foo $B &&
34-
test_must_fail test -f .git/packed-refs &&
34+
test_path_is_missing .git/packed-refs &&
3535
git update-ref refs/heads/foo $C $B &&
36-
test_must_fail test -f .git/packed-refs &&
36+
test_path_is_missing .git/packed-refs &&
3737
git update-ref -d refs/heads/foo &&
38-
test_must_fail test -f .git/packed-refs
38+
test_path_is_missing .git/packed-refs
3939
'
4040

4141
test_expect_success 'check that marking the packed-refs file works' '

0 commit comments

Comments
 (0)