Skip to content

Commit c8a0869

Browse files
drafnelgitster
authored andcommitted
t/t7003-filter-branch.sh: use test_must_fail rather than '!'
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 8114da1 commit c8a0869

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

t/t7003-filter-branch.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ test_expect_success 'filter subdirectory only' '
7878
test_expect_success 'subdirectory filter result looks okay' '
7979
test 2 = $(git rev-list sub | wc -l) &&
8080
git show sub:new &&
81-
! git show sub:subdir
81+
test_must_fail git show sub:subdir
8282
'
8383

8484
test_expect_success 'setup and filter history that requires --full-history' '
@@ -100,7 +100,7 @@ test_expect_success 'subdirectory filter result looks okay' '
100100
test 3 = $(git rev-list -1 --parents sub-master | wc -w) &&
101101
git show sub-master^:new &&
102102
git show sub-master^2:new &&
103-
! git show sub:subdir
103+
test_must_fail git show sub:subdir
104104
'
105105

106106
test_expect_success 'use index-filter to move into a subdirectory' '
@@ -114,7 +114,7 @@ test_expect_success 'use index-filter to move into a subdirectory' '
114114

115115
test_expect_success 'stops when msg filter fails' '
116116
old=$(git rev-parse HEAD) &&
117-
! git-filter-branch -f --msg-filter false HEAD &&
117+
test_must_fail git-filter-branch -f --msg-filter false HEAD &&
118118
test $old = $(git rev-parse HEAD) &&
119119
rm -rf .git-rewrite
120120
'
@@ -151,8 +151,8 @@ test_expect_success "remove a certain author's commits" '
151151
'
152152

153153
test_expect_success 'barf on invalid name' '
154-
! git filter-branch -f master xy-problem &&
155-
! git filter-branch -f HEAD^
154+
test_must_fail git filter-branch -f master xy-problem &&
155+
test_must_fail git filter-branch -f HEAD^
156156
'
157157

158158
test_expect_success '"map" works in commit filter' '
@@ -174,7 +174,7 @@ test_expect_success 'Name needing quotes' '
174174
git add foo &&
175175
git commit -m "Adding a file" &&
176176
git filter-branch --tree-filter "rm -fr foo" &&
177-
! git ls-files --error-unmatch "foo/$name" &&
177+
test_must_fail git ls-files --error-unmatch "foo/$name" &&
178178
test $(git rev-parse --verify rerere) != $(git rev-parse --verify A)
179179
180180
'

0 commit comments

Comments
 (0)