t/: Use "test_must_fail git" instead of "! git"
This patch changes every occurrence of "! git" -- with the meaning that a git call has to gracefully fail -- into "test_must_fail git". This is useful to - make sure the test does not fail because of a signal, e.g. SIGSEGV, and - advertise the use of "test_must_fail" for new tests. Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Stephan Beyer committed
Jul 12, 2008 at 17:47 UTC
d492b31cafe9aa5ce001b1d48815f4c0bb40d01a
58 files changed
+247
-233
t/t0000-basic.sh
+3
-3
@@ -63,7 +63,7 @@ test_expect_failure 'pretend we have fixed a known breakage' '
63
64
# updating a new file without --add should fail.
65
test_expect_success 'git update-index without --add should fail adding.' '
66
- ! git update-index should-be-empty
66
+ test_must_fail git update-index should-be-empty
67
'
68
69
# and with --add it should succeed, even if it is empty (it used to fail).
@@ -83,7 +83,7 @@ test_expect_success \
83
# Removing paths.
84
rm -f should-be-empty full-of-directories
85
test_expect_success 'git update-index without --remove should fail removing.' '
86
- ! git update-index should-be-empty
86
+ test_must_fail git update-index should-be-empty
87
'
88
89
test_expect_success \
@@ -217,7 +217,7 @@ test_expect_success \
217
'git update-index --index-info < badobjects'
218
219
test_expect_success 'writing this tree without --missing-ok.' '
220
- ! git write-tree
220
+ test_must_fail git write-tree
221
'
222
223
test_expect_success \
t/t0020-crlf.sh
+4
-4
@@ -52,7 +52,7 @@ test_expect_success 'safecrlf: autocrlf=input, all CRLF' '
52
git config core.safecrlf true &&
53
54
for w in I am all CRLF; do echo $w; done | append_cr >allcrlf &&
55
- ! git add allcrlf
55
+ test_must_fail git add allcrlf
56
'
57
58
test_expect_success 'safecrlf: autocrlf=input, mixed LF/CRLF' '
@@ -61,7 +61,7 @@ test_expect_success 'safecrlf: autocrlf=input, mixed LF/CRLF' '
61
git config core.safecrlf true &&
62
63
for w in Oh here is CRLFQ in text; do echo $w; done | q_to_cr >mixed &&
64
- ! git add mixed
64
+ test_must_fail git add mixed
65
'
66
67
test_expect_success 'safecrlf: autocrlf=true, all LF' '
@@ -70,7 +70,7 @@ test_expect_success 'safecrlf: autocrlf=true, all LF' '
70
git config core.safecrlf true &&
71
72
for w in I am all LF; do echo $w; done >alllf &&
73
- ! git add alllf
73
+ test_must_fail git add alllf
74
'
75
76
test_expect_success 'safecrlf: autocrlf=true mixed LF/CRLF' '
@@ -79,7 +79,7 @@ test_expect_success 'safecrlf: autocrlf=true mixed LF/CRLF' '
79
git config core.safecrlf true &&
80
81
for w in Oh here is CRLFQ in text; do echo $w; done | q_to_cr >mixed &&
82
- ! git add mixed
82
+ test_must_fail git add mixed
83
'
84
85
test_expect_success 'safecrlf: print warning only once' '
t/t0050-filesystem.sh
+1
-1
@@ -43,7 +43,7 @@ test_expect_success "detection of case insensitive filesystem during repo init"
43
else
44
test_expect_success "detection of case insensitive filesystem during repo init" '
45
46
- ! git config --bool core.ignorecase >/dev/null ||
46
+ test_must_fail git config --bool core.ignorecase >/dev/null ||
47
test $(git config --bool core.ignorecase) = false
48
'
49
fi
t/t1200-tutorial.sh
+1
-1
@@ -102,7 +102,7 @@ echo "Lots of fun" >>example
102
git commit -m 'Some fun.' -i hello example
103
104
test_expect_success 'git resolve now fails' '
105
- ! git merge -m "Merge work in mybranch" mybranch
105
+ test_must_fail git merge -m "Merge work in mybranch" mybranch
106
'
107
108
cat > hello << EOF
t/t1300-repo-config.sh
+10
-9
@@ -201,7 +201,7 @@ test_expect_success 'non-match value' \
201
'test wow = $(git config --get nextsection.nonewline !for)'
202
203
test_expect_success 'ambiguous get' '
204
- ! git config --get nextsection.nonewline
204
+ test_must_fail git config --get nextsection.nonewline
205
'
206
207
test_expect_success 'get multivar' \
@@ -223,15 +223,15 @@ EOF
223
test_expect_success 'multivar replace' 'cmp .git/config expect'
224
225
test_expect_success 'ambiguous value' '
226
- ! git config nextsection.nonewline
226
+ test_must_fail git config nextsection.nonewline
227
'
228
229
test_expect_success 'ambiguous unset' '
230
- ! git config --unset nextsection.nonewline
230
+ test_must_fail git config --unset nextsection.nonewline
231
'
232
233
test_expect_success 'invalid unset' '
234
- ! git config --unset somesection.nonewline
234
+ test_must_fail git config --unset somesection.nonewline
235
'
236
237
git config --unset nextsection.nonewline "wow3$"
@@ -248,7 +248,7 @@ EOF
248
249
test_expect_success 'multivar unset' 'cmp .git/config expect'
250
251
-test_expect_success 'invalid key' '! git config inval.2key blabla'
251
+test_expect_success 'invalid key' 'test_must_fail git config inval.2key blabla'
252
253
test_expect_success 'correct key' 'git config 123456.a123 987'
254
@@ -430,7 +430,8 @@ EOF
430
test_expect_success "rename succeeded" "test_cmp expect .git/config"
431
432
test_expect_success "rename non-existing section" '
433
- ! git config --rename-section branch."world domination" branch.drei
433
+ test_must_fail git config --rename-section \
434
+ branch."world domination" branch.drei
435
'
436
437
test_expect_success "rename succeeded" "test_cmp expect .git/config"
@@ -545,11 +546,11 @@ test_expect_success bool '
546
test_expect_success 'invalid bool (--get)' '
547
548
git config bool.nobool foobar &&
548
- ! git config --bool --get bool.nobool'
549
+ test_must_fail git config --bool --get bool.nobool'
550
551
test_expect_success 'invalid bool (set)' '
552
552
- ! git config --bool bool.nobool foobar'
553
+ test_must_fail git config --bool bool.nobool foobar'
554
555
rm .git/config
556
@@ -669,7 +670,7 @@ EOF
670
test_expect_success 'quoting' 'cmp .git/config expect'
671
672
test_expect_success 'key with newline' '
672
- ! git config "key.with
673
+ test_must_fail git config "key.with
674
newline" 123'
675
676
test_expect_success 'value with newline' 'git config key.sub value.with\\\
t/t1302-repo-version.sh
+1
-1
@@ -41,7 +41,7 @@ test_expect_success 'gitdir required mode on normal repos' '
41
cd test && git apply --check --index ../test.patch)'
42
43
test_expect_success 'gitdir required mode on unsupported repo' '
44
- (cd test2 && ! git apply --check --index ../test.patch)
44
+ (cd test2 && test_must_fail git apply --check --index ../test.patch)
45
'
46
47
test_done
t/t1400-update-ref.sh
+2
-2
@@ -76,7 +76,7 @@ test_expect_success "delete $m (by HEAD)" '
76
rm -f .git/$m
77
78
test_expect_success '(not) create HEAD with old sha1' "
79
- ! git update-ref HEAD $A $B
79
+ test_must_fail git update-ref HEAD $A $B
80
"
81
test_expect_success "(not) prior created .git/$m" "
82
! test -f .git/$m
@@ -87,7 +87,7 @@ test_expect_success \
87
"create HEAD" \
88
"git update-ref HEAD $A"
89
test_expect_success '(not) change HEAD with wrong SHA1' "
90
- ! git update-ref HEAD $B $Z
90
+ test_must_fail git update-ref HEAD $B $Z
91
"
92
test_expect_success "(not) changed .git/$m" "
93
! test $B"' = $(cat .git/'"$m"')
t/t2000-checkout-cache-clash.sh
+1
-1
@@ -38,7 +38,7 @@ date >path1
38
39
test_expect_success \
40
'git checkout-index without -f should fail on conflicting work tree.' \
41
- '! git checkout-index -a'
41
+ 'test_must_fail git checkout-index -a'
42
43
test_expect_success \
44
'git checkout-index with -f should succeed.' \
t/t2100-update-cache-badpath.sh
+1
-1
@@ -46,6 +46,6 @@ for p in path0/file0 path1/file1 path2 path3
46
do
47
test_expect_success \
48
"git update-index to add conflicting path $p should fail." \
49
- "! git update-index --add -- $p"
49
+ "test_must_fail git update-index --add -- $p"
50
done
51
test_done
t/t3020-ls-files-error-unmatch.sh
+1
-1
@@ -17,7 +17,7 @@ git-commit -m "add foo bar"
17
18
test_expect_success \
19
'git ls-files --error-unmatch should fail with unmatched path.' \
20
- '! git ls-files --error-unmatch foo bar-does-not-match'
20
+ 'test_must_fail git ls-files --error-unmatch foo bar-does-not-match'
21
22
test_expect_success \
23
'git ls-files --error-unmatch should succeed eith matched paths.' \
t/t3200-branch.sh
+4
-4
@@ -78,13 +78,13 @@ test_expect_success \
78
test_expect_success 'git branch -m o/o o should fail when o/p exists' '
79
git branch o/o &&
80
git branch o/p &&
81
- ! git branch -m o/o o
81
+ test_must_fail git branch -m o/o o
82
'
83
84
test_expect_success 'git branch -m q r/q should fail when r exists' '
85
git branch q &&
86
git branch r &&
87
- ! git branch -m q r/q
87
+ test_must_fail git branch -m q r/q
88
'
89
90
mv .git/config .git/config-saved
@@ -110,14 +110,14 @@ test_expect_success \
110
111
test_expect_success 'config information was renamed, too' \
112
"test $(git config branch.s.dummy) = Hello &&
113
- ! git config branch.s/s/dummy"
113
+ test_must_fail git config branch.s/s/dummy"
114
115
test_expect_success \
116
'git branch -m u v should fail when the reflog for u is a symlink' '
117
git branch -l u &&
118
mv .git/logs/refs/heads/u real-u &&
119
ln -s real-u .git/logs/refs/heads/u &&
120
- ! git branch -m u v
120
+ test_must_fail git branch -m u v
121
'
122
123
test_expect_success 'test tracking setup via --track' \
t/t3210-pack-refs.sh
+2
-2
@@ -43,7 +43,7 @@ test_expect_success 'git branch c/d should barf if branch c exists' '
43
git branch c &&
44
git pack-refs --all &&
45
rm -f .git/refs/heads/c &&
46
- ! git branch c/d
46
+ test_must_fail git branch c/d
47
'
48
49
test_expect_success \
@@ -72,7 +72,7 @@ test_expect_success \
72
test_expect_success 'git branch i/j/k should barf if branch i exists' '
73
git branch i &&
74
git pack-refs --all --prune &&
75
- ! git branch i/j/k
75
+ test_must_fail git branch i/j/k
76
'
77
78
test_expect_success \
t/t3403-rebase-skip.sh
+5
-3
@@ -32,7 +32,7 @@ test_expect_success setup '
32
'
33
34
test_expect_success 'rebase with git am -3 (default)' '
35
- ! git rebase master
35
+ test_must_fail git rebase master
36
'
37
38
test_expect_success 'rebase --skip with am -3' '
@@ -43,7 +43,7 @@ test_expect_success 'rebase moves back to skip-reference' '
43
test refs/heads/skip-reference = $(git symbolic-ref HEAD) &&
44
git branch post-rebase &&
45
git reset --hard pre-rebase &&
46
- ! git rebase master &&
46
+ test_must_fail git rebase master &&
47
echo "hello" > hello &&
48
git add hello &&
49
git rebase --continue &&
@@ -53,7 +53,9 @@ test_expect_success 'rebase moves back to skip-reference' '
53
54
test_expect_success 'checkout skip-merge' 'git checkout -f skip-merge'
55
56
-test_expect_success 'rebase with --merge' '! git rebase --merge master'
56
+test_expect_success 'rebase with --merge' '
57
+ test_must_fail git rebase --merge master
58
+'
59
60
test_expect_success 'rebase --skip with --merge' '
61
git rebase --skip
t/t3502-cherry-pick-merge.sh
+6
-6
@@ -35,7 +35,7 @@ test_expect_success 'cherry-pick a non-merge with -m should fail' '
35
36
git reset --hard &&
37
git checkout a^0 &&
38
- ! git cherry-pick -m 1 b &&
38
+ test_must_fail git cherry-pick -m 1 b &&
39
git diff --exit-code a --
40
41
'
@@ -44,7 +44,7 @@ test_expect_success 'cherry pick a merge without -m should fail' '
44
45
git reset --hard &&
46
git checkout a^0 &&
47
- ! git cherry-pick c &&
47
+ test_must_fail git cherry-pick c &&
48
git diff --exit-code a --
49
50
'
@@ -71,7 +71,7 @@ test_expect_success 'cherry pick a merge relative to nonexistent parent should f
71
72
git reset --hard &&
73
git checkout b^0 &&
74
- ! git cherry-pick -m 3 c
74
+ test_must_fail git cherry-pick -m 3 c
75
76
'
77
@@ -79,7 +79,7 @@ test_expect_success 'revert a non-merge with -m should fail' '
79
80
git reset --hard &&
81
git checkout c^0 &&
82
- ! git revert -m 1 b &&
82
+ test_must_fail git revert -m 1 b &&
83
git diff --exit-code c
84
85
'
@@ -88,7 +88,7 @@ test_expect_success 'revert a merge without -m should fail' '
88
89
git reset --hard &&
90
git checkout c^0 &&
91
- ! git revert c &&
91
+ test_must_fail git revert c &&
92
git diff --exit-code c
93
94
'
@@ -115,7 +115,7 @@ test_expect_success 'revert a merge relative to nonexistent parent should fail'
115
116
git reset --hard &&
117
git checkout c^0 &&
118
- ! git revert -m 3 c &&
118
+ test_must_fail git revert -m 3 c &&
119
git diff --exit-code c
120
121
'
t/t3600-rm.sh
+13
-13
@@ -67,7 +67,7 @@ test_expect_success \
67
echo "other content" > foo
68
git add foo
69
echo "yet another content" > foo
70
- ! git rm --cached foo
70
+ test_must_fail git rm --cached foo
71
'
72
73
test_expect_success \
@@ -82,7 +82,7 @@ test_expect_success \
82
83
test_expect_success \
84
'Post-check that foo exists but is not in index after git rm foo' \
85
- '[ -f foo ] && ! git ls-files --error-unmatch foo'
85
+ '[ -f foo ] && test_must_fail git ls-files --error-unmatch foo'
86
87
test_expect_success \
88
'Pre-check that bar exists and is in index before "git rm bar"' \
@@ -94,7 +94,7 @@ test_expect_success \
94
95
test_expect_success \
96
'Post-check that bar does not exist and is not in index after "git rm -f bar"' \
97
- '! [ -f bar ] && ! git ls-files --error-unmatch bar'
97
+ '! [ -f bar ] && test_must_fail git ls-files --error-unmatch bar'
98
99
test_expect_success \
100
'Test that "git rm -- -q" succeeds (remove a file that looks like an option)' \
@@ -109,7 +109,7 @@ if test "$test_failed_remove" = y; then
109
chmod a-w .
110
test_expect_success \
111
'Test that "git rm -f" fails if its rm fails' \
112
- '! git rm -f baz'
112
+ 'test_must_fail git rm -f baz'
113
chmod 775 .
114
else
115
test_expect_success 'skipping removal failure (perhaps running as root?)' :
@@ -151,7 +151,7 @@ test_expect_success 'Re-add foo and baz' '
151
152
test_expect_success 'Modify foo -- rm should refuse' '
153
echo >>foo &&
154
- ! git rm foo baz &&
154
+ test_must_fail git rm foo baz &&
155
test -f foo &&
156
test -f baz &&
157
git ls-files --error-unmatch foo baz
@@ -161,8 +161,8 @@ test_expect_success 'Modified foo -- rm -f should work' '
161
git rm -f foo baz &&
162
test ! -f foo &&
163
test ! -f baz &&
164
- ! git ls-files --error-unmatch foo &&
165
- ! git ls-files --error-unmatch bar
164
+ test_must_fail git ls-files --error-unmatch foo &&
165
+ test_must_fail git ls-files --error-unmatch bar
166
'
167
168
test_expect_success 'Re-add foo and baz for HEAD tests' '
@@ -173,7 +173,7 @@ test_expect_success 'Re-add foo and baz for HEAD tests' '
173
'
174
175
test_expect_success 'foo is different in index from HEAD -- rm should refuse' '
176
- ! git rm foo baz &&
176
+ test_must_fail git rm foo baz &&
177
test -f foo &&
178
test -f baz &&
179
git ls-files --error-unmatch foo baz
@@ -183,8 +183,8 @@ test_expect_success 'but with -f it should work.' '
183
git rm -f foo baz &&
184
test ! -f foo &&
185
test ! -f baz &&
186
- ! git ls-files --error-unmatch foo
187
- ! git ls-files --error-unmatch baz
186
+ test_must_fail git ls-files --error-unmatch foo
187
+ test_must_fail git ls-files --error-unmatch baz
188
'
189
190
test_expect_success 'Recursive test setup' '
@@ -195,14 +195,14 @@ test_expect_success 'Recursive test setup' '
195
'
196
197
test_expect_success 'Recursive without -r fails' '
198
- ! git rm frotz &&
198
+ test_must_fail git rm frotz &&
199
test -d frotz &&
200
test -f frotz/nitfol
201
'
202
203
test_expect_success 'Recursive with -r but dirty' '
204
echo qfwfq >>frotz/nitfol
205
- ! git rm -r frotz &&
205
+ test_must_fail git rm -r frotz &&
206
test -d frotz &&
207
test -f frotz/nitfol
208
'
@@ -214,7 +214,7 @@ test_expect_success 'Recursive with -r -f' '
214
'
215
216
test_expect_success 'Remove nonexistent file returns nonzero exit status' '
217
- ! git rm nonexistent
217
+ test_must_fail git rm nonexistent
218
'
219
220
test_done
t/t3700-add.sh
+2
-2
@@ -85,12 +85,12 @@ test_expect_success '.gitignore is honored' '
85
'
86
87
test_expect_success 'error out when attempting to add ignored ones without -f' '
88
- ! git add a.?? &&
88
+ test_must_fail git add a.?? &&
89
! (git ls-files | grep "\\.ig")
90
'
91
92
test_expect_success 'error out when attempting to add ignored ones without -f' '
93
- ! git add d.?? &&
93
+ test_must_fail git add d.?? &&
94
! (git ls-files | grep "\\.ig")
95
'
96
t/t4015-diff-whitespace.sh
+14
-14
@@ -144,7 +144,7 @@ test_expect_success 'check with no whitespace errors' '
144
test_expect_success 'check with trailing whitespace' '
145
146
echo "foo(); " > x &&
147
- ! git diff --check
147
+ test_must_fail git diff --check
148
149
'
150
@@ -152,7 +152,7 @@ test_expect_success 'check with space before tab in indent' '
152
153
# indent has space followed by hard tab
154
echo " foo();" > x &&
155
- ! git diff --check
155
+ test_must_fail git diff --check
156
157
'
158
@@ -181,7 +181,7 @@ test_expect_success 'check staged with trailing whitespace' '
181
182
echo "foo(); " > x &&
183
git add x &&
184
- ! git diff --cached --check
184
+ test_must_fail git diff --cached --check
185
186
'
187
@@ -190,7 +190,7 @@ test_expect_success 'check staged with space before tab in indent' '
190
# indent has space followed by hard tab
191
echo " foo();" > x &&
192
git add x &&
193
- ! git diff --cached --check
193
+ test_must_fail git diff --cached --check
194
195
'
196
@@ -206,7 +206,7 @@ test_expect_success 'check with trailing whitespace (diff-index)' '
206
207
echo "foo(); " > x &&
208
git add x &&
209
- ! git diff-index --check HEAD
209
+ test_must_fail git diff-index --check HEAD
210
211
'
212
@@ -215,7 +215,7 @@ test_expect_success 'check with space before tab in indent (diff-index)' '
215
# indent has space followed by hard tab
216
echo " foo();" > x &&
217
git add x &&
218
- ! git diff-index --check HEAD
218
+ test_must_fail git diff-index --check HEAD
219
220
'
221
@@ -231,7 +231,7 @@ test_expect_success 'check staged with trailing whitespace (diff-index)' '
231
232
echo "foo(); " > x &&
233
git add x &&
234
- ! git diff-index --cached --check HEAD
234
+ test_must_fail git diff-index --cached --check HEAD
235
236
'
237
@@ -240,7 +240,7 @@ test_expect_success 'check staged with space before tab in indent (diff-index)'
240
# indent has space followed by hard tab
241
echo " foo();" > x &&
242
git add x &&
243
- ! git diff-index --cached --check HEAD
243
+ test_must_fail git diff-index --cached --check HEAD
244
245
'
246
@@ -256,7 +256,7 @@ test_expect_success 'check with trailing whitespace (diff-tree)' '
256
257
echo "foo(); " > x &&
258
git commit -m "another commit" x &&
259
- ! git diff-tree --check HEAD^ HEAD
259
+ test_must_fail git diff-tree --check HEAD^ HEAD
260
261
'
262
@@ -265,7 +265,7 @@ test_expect_success 'check with space before tab in indent (diff-tree)' '
265
# indent has space followed by hard tab
266
echo " foo();" > x &&
267
git commit -m "yet another" x &&
268
- ! git diff-tree --check HEAD^ HEAD
268
+ test_must_fail git diff-tree --check HEAD^ HEAD
269
270
'
271
@@ -281,7 +281,7 @@ test_expect_success 'check trailing whitespace (trailing-space: on)' '
281
282
git config core.whitespace "trailing-space" &&
283
echo "foo (); " > x &&
284
- ! git diff --check
284
+ test_must_fail git diff --check
285
286
'
287
@@ -299,7 +299,7 @@ test_expect_success 'check space before tab in indent (space-before-tab: on)' '
299
# indent contains space followed by HT
300
git config core.whitespace "space-before-tab" &&
301
echo " foo (); " > x &&
302
- ! git diff --check
302
+ test_must_fail git diff --check
303
304
'
305
@@ -315,7 +315,7 @@ test_expect_success 'check spaces as indentation (indent-with-non-tab: on)' '
315
316
git config core.whitespace "indent-with-non-tab" &&
317
echo " foo ();" > x &&
318
- ! git diff --check
318
+ test_must_fail git diff --check
319
320
'
321
@@ -323,7 +323,7 @@ test_expect_success 'check tabs and spaces as indentation (indent-with-non-tab:
323
324
git config core.whitespace "indent-with-non-tab" &&
325
echo " foo ();" > x &&
326
- ! git diff --check
326
+ test_must_fail git diff --check
327
328
'
329
t/t4018-diff-funcname.sh
+1
-1
@@ -54,7 +54,7 @@ test_expect_success 'custom pattern' '
54
55
test_expect_success 'last regexp must not be negated' '
56
git config diff.java.funcname "!static" &&
57
- ! git diff --no-index Beer.java Beer-correct.java
57
+ test_must_fail git diff --no-index Beer.java Beer-correct.java
58
'
59
60
test_done
t/t4103-apply-binary.sh
+8
-8
@@ -48,22 +48,22 @@ test_expect_success 'stat binary diff (copy) -- should not fail.' \
48
49
test_expect_success 'check binary diff -- should fail.' \
50
'git-checkout master &&
51
- ! git apply --check B.diff'
51
+ test_must_fail git apply --check B.diff'
52
53
test_expect_success 'check binary diff (copy) -- should fail.' \
54
'git-checkout master &&
55
- ! git apply --check C.diff'
55
+ test_must_fail git apply --check C.diff'
56
57
test_expect_success \
58
'check incomplete binary diff with replacement -- should fail.' '
59
git-checkout master &&
60
- ! git apply --check --allow-binary-replacement B.diff
60
+ test_must_fail git apply --check --allow-binary-replacement B.diff
61
'
62
63
test_expect_success \
64
'check incomplete binary diff with replacement (copy) -- should fail.' '
65
git-checkout master &&
66
- ! git apply --check --allow-binary-replacement C.diff
66
+ test_must_fail git apply --check --allow-binary-replacement C.diff
67
'
68
69
test_expect_success 'check binary diff with replacement.' \
@@ -84,19 +84,19 @@ do_reset () {
84
85
test_expect_success 'apply binary diff -- should fail.' \
86
'do_reset &&
87
- ! git apply B.diff'
87
+ test_must_fail git apply B.diff'
88
89
test_expect_success 'apply binary diff -- should fail.' \
90
'do_reset &&
91
- ! git apply --index B.diff'
91
+ test_must_fail git apply --index B.diff'
92
93
test_expect_success 'apply binary diff (copy) -- should fail.' \
94
'do_reset &&
95
- ! git apply C.diff'
95
+ test_must_fail git apply C.diff'
96
97
test_expect_success 'apply binary diff (copy) -- should fail.' \
98
'do_reset &&
99
- ! git apply --index C.diff'
99
+ test_must_fail git apply --index C.diff'
100
101
test_expect_success 'apply binary diff without replacement.' \
102
'do_reset &&
t/t4113-apply-ending.sh
+2
-2
@@ -30,7 +30,7 @@ test_expect_success setup \
30
# test
31
32
test_expect_success 'apply at the end' \
33
- '! git apply --index test-patch'
33
+ 'test_must_fail git apply --index test-patch'
34
35
cat >test-patch <<\EOF
36
diff a/file b/file
@@ -48,6 +48,6 @@ c'
48
git update-index file
49
50
test_expect_success 'apply at the beginning' \
51
- '! git apply --index test-patch'
51
+ 'test_must_fail git apply --index test-patch'
52
53
test_done
t/t4150-am.sh
+4
-4
@@ -182,7 +182,7 @@ test_expect_success 'am -3 falls back to 3-way merge' '
182
183
test_expect_success 'am pauses on conflict' '
184
git checkout lorem2^^ &&
185
- ! git am lorem-move.patch &&
185
+ test_must_fail git am lorem-move.patch &&
186
test -d .dotest
187
'
188
@@ -195,7 +195,7 @@ test_expect_success 'am --skip works' '
195
196
test_expect_success 'am --resolved works' '
197
git checkout lorem2^^ &&
198
- ! git am lorem-move.patch &&
198
+ test_must_fail git am lorem-move.patch &&
199
test -d .dotest &&
200
echo resolved >>file &&
201
git add file &&
@@ -212,13 +212,13 @@ test_expect_success 'am takes patches from a Pine mailbox' '
212
'
213
214
test_expect_success 'am fails on mail without patch' '
215
- ! git am <failmail &&
215
+ test_must_fail git am <failmail &&
216
rm -r .dotest/
217
'
218
219
test_expect_success 'am fails on empty patch' '
220
echo "---" >>failmail &&
221
- ! git am <failmail &&
221
+ test_must_fail git am <failmail &&
222
git am --skip &&
223
! test -d .dotest
224
'
t/t4200-rerere.sh
+5
-5
@@ -41,7 +41,7 @@ git commit -q -a -m second
41
42
test_expect_success 'nothing recorded without rerere' '
43
(rm -rf .git/rr-cache; git config rerere.enabled false) &&
44
- ! git merge first &&
44
+ test_must_fail git merge first &&
45
! test -d .git/rr-cache
46
'
47
@@ -50,7 +50,7 @@ test_expect_success 'conflicting merge' '
50
git reset --hard &&
51
mkdir .git/rr-cache &&
52
git config --unset rerere.enabled &&
53
- ! git merge first
53
+ test_must_fail git merge first
54
'
55
56
sha1=$(sed -e 's/ .*//' .git/rr-cache/MERGE_RR)
@@ -61,7 +61,7 @@ test_expect_success 'rerere.enabled works, too' '
61
rm -rf .git/rr-cache &&
62
git config rerere.enabled true &&
63
git reset --hard &&
64
- ! git merge first &&
64
+ test_must_fail git merge first &&
65
grep ======= $rr/preimage
66
'
67
@@ -120,7 +120,7 @@ test_expect_success 'another conflicting merge' '
120
git checkout -b third master &&
121
git show second^:a1 | sed "s/To die: t/To die! T/" > a1 &&
122
git commit -q -a -m third &&
123
- ! git pull . first
123
+ test_must_fail git pull . first
124
'
125
126
git show first:a1 | sed 's/To die: t/To die! T/' > expect
@@ -175,7 +175,7 @@ test_expect_success 'file2 added differently in two branches' '
175
echo Bello > file2 &&
176
git add file2 &&
177
git commit -m version2 &&
178
- ! git merge fourth &&
178
+ test_must_fail git merge fourth &&
179
sha1=$(sed -e "s/ .*//" .git/rr-cache/MERGE_RR) &&
180
rr=.git/rr-cache/$sha1 &&
181
echo Cello > file2 &&
t/t5300-pack-object.sh
+1
-1
@@ -266,7 +266,7 @@ test_expect_success \
266
267
test_expect_success \
268
'make sure index-pack detects the SHA1 collision' \
269
- '! git-index-pack -o bad.idx test-3.pack'
269
+ 'test_must_fail git-index-pack -o bad.idx test-3.pack'
270
271
test_expect_success \
272
'honor pack.packSizeLimit' \
t/t5302-pack-index.sh
+6
-5
@@ -118,7 +118,7 @@ test_expect_success \
118
119
test_expect_success \
120
'[index v1] 4) confirm that the pack is actually corrupted' \
121
- '! git fsck --full $commit'
121
+ 'test_must_fail git fsck --full $commit'
122
123
test_expect_success \
124
'[index v1] 5) pack-objects happily reuses corrupted data' \
@@ -127,7 +127,7 @@ test_expect_success \
127
128
test_expect_success \
129
'[index v1] 6) newly created pack is BAD !' \
130
- '! git verify-pack -v "test-4-${pack1}.pack"'
130
+ 'test_must_fail git verify-pack -v "test-4-${pack1}.pack"'
131
132
test_expect_success \
133
'[index v2] 1) stream pack to repository' \
@@ -156,11 +156,11 @@ test_expect_success \
156
157
test_expect_success \
158
'[index v2] 4) confirm that the pack is actually corrupted' \
159
- '! git fsck --full $commit'
159
+ 'test_must_fail git fsck --full $commit'
160
161
test_expect_success \
162
'[index v2] 5) pack-objects refuses to reuse corrupted data' \
163
- '! git pack-objects test-5 <obj-list'
163
+ 'test_must_fail git pack-objects test-5 <obj-list'
164
165
test_expect_success \
166
'[index v2] 6) verify-pack detects CRC mismatch' \
@@ -173,7 +173,8 @@ test_expect_success \
173
( while read obj
174
do git cat-file -p $obj >/dev/null || exit 1
175
done <obj-list ) &&
176
- err=$(! git verify-pack ".git/objects/pack/pack-${pack1}.pack" 2>&1) &&
176
+ err=$(test_must_fail git verify-pack \
177
+ ".git/objects/pack/pack-${pack1}.pack" 2>&1) &&
178
echo "$err" | grep "CRC mismatch"'
179
180
test_done
t/t5401-update-hooks.sh
+2
-1
@@ -61,7 +61,8 @@ EOF
61
chmod u+x victim/.git/hooks/post-update
62
63
test_expect_success push '
64
- ! git-send-pack --force ./victim/.git master tofail >send.out 2>send.err
64
+ test_must_fail git-send-pack --force ./victim/.git \
65
+ master tofail >send.out 2>send.err
66
'
67
68
test_expect_success 'updated as expected' '
t/t5404-tracking-branches.sh
+3
-1
@@ -35,7 +35,9 @@ test_expect_success 'prepare pushable branches' '
35
git commit -a -m aa-master
36
'
37
38
-test_expect_success 'mixed-success push returns error' '! git push'
38
+test_expect_success 'mixed-success push returns error' '
39
+ test_must_fail git push
40
+'
41
42
test_expect_success 'check tracking branches updated correctly after push' '
43
test "$(git rev-parse origin/master)" = "$(git rev-parse master)"
t/t5406-remote-rejects.sh
+1
-1
@@ -17,7 +17,7 @@ test_expect_success 'setup' '
17
git commit -a -m 2
18
'
19
20
-test_expect_success 'push reports error' '! git push 2>stderr'
20
+test_expect_success 'push reports error' 'test_must_fail git push 2>stderr'
21
22
test_expect_success 'individual ref reports error' 'grep rejected stderr'
23
t/t5500-fetch-pack.sh
+1
-1
@@ -177,6 +177,6 @@ test_expect_success "clone shallow object count" \
177
"test \"count: 18\" = \"$(grep count count.shallow)\""
178
179
test_expect_success "pull in shallow repo with missing merge base" \
180
- "(cd shallow && ! git pull --depth 4 .. A)"
180
+ "(cd shallow && test_must_fail git pull --depth 4 .. A)"
181
182
test_done
t/t5505-remote.sh
+7
-7
@@ -164,7 +164,7 @@ test_expect_success 'prune' '
164
git fetch origin &&
165
git remote prune origin &&
166
git rev-parse refs/remotes/origin/side2 &&
167
- ! git rev-parse refs/remotes/origin/side)
167
+ test_must_fail git rev-parse refs/remotes/origin/side)
168
'
169
170
cat > test/expect << EOF
@@ -179,7 +179,7 @@ test_expect_success 'prune --dry-run' '
179
(cd test &&
180
git remote prune --dry-run origin > output &&
181
git rev-parse refs/remotes/origin/side2 &&
182
- ! git rev-parse refs/remotes/origin/side &&
182
+ test_must_fail git rev-parse refs/remotes/origin/side &&
183
(cd ../one &&
184
git branch -m side side2) &&
185
test_cmp expect output)
@@ -194,10 +194,10 @@ test_expect_success 'add --mirror && prune' '
194
git branch -m side2 side) &&
195
(cd mirror &&
196
git rev-parse --verify refs/heads/side2 &&
197
- ! git rev-parse --verify refs/heads/side &&
197
+ test_must_fail git rev-parse --verify refs/heads/side &&
198
git fetch origin &&
199
git remote prune origin &&
200
- ! git rev-parse --verify refs/heads/side2 &&
200
+ test_must_fail git rev-parse --verify refs/heads/side2 &&
201
git rev-parse --verify refs/heads/side)
202
'
203
@@ -212,10 +212,10 @@ test_expect_success 'add alt && prune' '
212
git branch -m side side2) &&
213
(cd alttst &&
214
git rev-parse --verify refs/remotes/origin/side &&
215
- ! git rev-parse --verify refs/remotes/origin/side2 &&
215
+ test_must_fail git rev-parse --verify refs/remotes/origin/side2 &&
216
git fetch alt &&
217
git remote prune alt &&
218
- ! git rev-parse --verify refs/remotes/origin/side &&
218
+ test_must_fail git rev-parse --verify refs/remotes/origin/side &&
219
git rev-parse --verify refs/remotes/origin/side2)
220
'
221
@@ -320,7 +320,7 @@ test_expect_success '"remote show" does not show symbolic refs' '
320
321
test_expect_success 'reject adding remote with an invalid name' '
322
323
- ! git remote add some:url desired-name
323
+ test_must_fail git remote add some:url desired-name
324
325
'
326
t/t5510-fetch.sh
+6
-6
@@ -104,7 +104,7 @@ test_expect_success 'fetch must not resolve short tag name' '
104
cd five &&
105
git init &&
106
107
- ! git fetch .. anno:five
107
+ test_must_fail git fetch .. anno:five
108
109
'
110
@@ -117,7 +117,7 @@ test_expect_success 'fetch must not resolve short remote name' '
117
cd six &&
118
git init &&
119
120
- ! git fetch .. six:six
120
+ test_must_fail git fetch .. six:six
121
122
'
123
@@ -143,7 +143,7 @@ test_expect_success 'create bundle 2' '
143
test_expect_success 'unbundle 1' '
144
cd "$D/bundle" &&
145
git checkout -b some-branch &&
146
- ! git fetch "$D/bundle1" master:master
146
+ test_must_fail git fetch "$D/bundle1" master:master
147
'
148
149
test_expect_success 'bundle 1 has only 3 files ' '
@@ -236,7 +236,7 @@ test_expect_success 'fetch with a non-applying branch.<name>.merge' '
236
237
# the strange name is: a\!'b
238
test_expect_success 'quoting of a strangely named repo' '
239
- ! git fetch "a\\!'\''b" > result 2>&1 &&
239
+ test_must_fail git fetch "a\\!'\''b" > result 2>&1 &&
240
cat result &&
241
grep "fatal: '\''a\\\\!'\''b'\''" result
242
'
@@ -264,7 +264,7 @@ test_expect_success 'explicit fetch should not update tracking' '
264
git fetch origin master &&
265
n=$(git rev-parse --verify refs/remotes/origin/master) &&
266
test "$o" = "$n" &&
267
- ! git rev-parse --verify refs/remotes/origin/side
267
+ test_must_fail git rev-parse --verify refs/remotes/origin/side
268
)
269
'
270
@@ -278,7 +278,7 @@ test_expect_success 'explicit pull should not update tracking' '
278
git pull origin master &&
279
n=$(git rev-parse --verify refs/remotes/origin/master) &&
280
test "$o" = "$n" &&
281
- ! git rev-parse --verify refs/remotes/origin/side
281
+ test_must_fail git rev-parse --verify refs/remotes/origin/side
282
)
283
'
284
t/t5516-fetch-push.sh
+4
-4
@@ -178,7 +178,7 @@ test_expect_success 'failed (non-fast-forward) push with matching heads' '
178
mk_test heads/master &&
179
git push testrepo : &&
180
git commit --amend -massaged &&
181
- ! git push testrepo &&
181
+ test_must_fail git push testrepo &&
182
check_push_result $the_commit heads/master &&
183
git reset --hard $the_commit
184
@@ -374,7 +374,7 @@ test_expect_success 'push with +HEAD' '
374
375
# Without force rewinding should fail
376
git reset --hard HEAD^ &&
377
- ! git push testrepo HEAD &&
377
+ test_must_fail git push testrepo HEAD &&
378
check_push_result $the_commit heads/local &&
379
380
# With force rewinding should succeed
@@ -448,7 +448,7 @@ test_expect_success 'push does not update local refs on failure' '
448
git clone parent child &&
449
(cd child &&
450
echo two >foo && git commit -a -m two &&
451
- ! git push &&
451
+ test_must_fail git push &&
452
test $(git rev-parse master) != \
453
$(git rev-parse remotes/origin/master))
454
@@ -459,7 +459,7 @@ test_expect_success 'allow deleting an invalid remote ref' '
459
pwd &&
460
rm -f testrepo/.git/objects/??/* &&
461
git push testrepo :refs/heads/master &&
462
- (cd testrepo && ! git rev-parse --verify refs/heads/master)
462
+ (cd testrepo && test_must_fail git rev-parse --verify refs/heads/master)
463
464
'
465
t/t5530-upload-pack-error.sh
+3
-3
@@ -27,7 +27,7 @@ test_expect_success 'setup and corrupt repository' '
27
'
28
29
test_expect_success 'fsck fails' '
30
- ! git fsck
30
+ test_must_fail git fsck
31
'
32
33
test_expect_success 'upload-pack fails due to error in pack-objects' '
@@ -46,7 +46,7 @@ test_expect_success 'corrupt repo differently' '
46
'
47
48
test_expect_success 'fsck fails' '
49
- ! git fsck
49
+ test_must_fail git fsck
50
'
51
test_expect_success 'upload-pack fails due to error in rev-list' '
52
@@ -66,7 +66,7 @@ test_expect_success 'create empty repository' '
66
67
test_expect_success 'fetch fails' '
68
69
- ! git fetch .. master
69
+ test_must_fail git fetch .. master
70
71
'
72
t/t5540-http-push.sh
+1
-1
@@ -73,7 +73,7 @@ test_expect_failure 'create and delete remote branch' '
73
git push origin :dev &&
74
git branch -d -r origin/dev &&
75
git fetch &&
76
- ! git show-ref --verify refs/remotes/origin/dev
76
+ test_must_fail git show-ref --verify refs/remotes/origin/dev
77
'
78
79
stop_httpd
t/t5600-clone-fail-cleanup.sh
+2
-2
@@ -13,7 +13,7 @@ remove the directory before attempting a clone again.'
13
14
test_expect_success \
15
'clone of non-existent source should fail' \
16
- '! git-clone foo bar'
16
+ 'test_must_fail git-clone foo bar'
17
18
test_expect_success \
19
'failed clone should not leave a directory' \
@@ -29,7 +29,7 @@ test_create_repo foo
29
# current path not to the target dir
30
test_expect_success \
31
'clone of non-existent (relative to $PWD) source should fail' \
32
- '! git-clone ../foo baz'
32
+ 'test_must_fail git-clone ../foo baz'
33
34
test_expect_success \
35
'clone should work now that source exists' \
t/t6023-merge-file.sh
+8
-6
@@ -67,7 +67,7 @@ test_expect_success "merge result added missing LF" \
67
68
cp test.txt backup.txt
69
test_expect_success "merge with conflicts" \
70
- "! git merge-file test.txt orig.txt new3.txt"
70
+ "test_must_fail git merge-file test.txt orig.txt new3.txt"
71
72
cat > expect.txt << EOF
73
<<<<<<< test.txt
@@ -90,7 +90,7 @@ test_expect_success "expected conflict markers" "test_cmp test.txt expect.txt"
90
91
cp backup.txt test.txt
92
test_expect_success "merge with conflicts, using -L" \
93
- "! git merge-file -L 1 -L 2 test.txt orig.txt new3.txt"
93
+ "test_must_fail git merge-file -L 1 -L 2 test.txt orig.txt new3.txt"
94
95
cat > expect.txt << EOF
96
<<<<<<< 1
@@ -114,7 +114,7 @@ test_expect_success "expected conflict markers, with -L" \
114
115
sed "s/ tu / TU /" < new1.txt > new5.txt
116
test_expect_success "conflict in removed tail" \
117
- "! git merge-file -p orig.txt new1.txt new5.txt > out"
117
+ "test_must_fail git merge-file -p orig.txt new1.txt new5.txt > out"
118
119
cat > expect << EOF
120
Dominus regit me,
@@ -135,7 +135,8 @@ EOF
135
test_expect_success "expected conflict markers" "test_cmp expect out"
136
137
test_expect_success 'binary files cannot be merged' '
138
- ! git merge-file -p orig.txt ../test4012.png new1.txt 2> merge.err &&
138
+ test_must_fail git merge-file -p \
139
+ orig.txt ../test4012.png new1.txt 2> merge.err &&
140
grep "Cannot merge binary files" merge.err
141
'
142
@@ -144,7 +145,7 @@ sed -e "s/deerit.$/deerit,/" -e "s/me;$/me,/" < new5.txt > new7.txt
145
146
test_expect_success 'MERGE_ZEALOUS simplifies non-conflicts' '
147
147
- ! git merge-file -p new6.txt new5.txt new7.txt > output &&
148
+ test_must_fail git merge-file -p new6.txt new5.txt new7.txt > output &&
149
test 1 = $(grep ======= < output | wc -l)
150
151
'
@@ -154,7 +155,8 @@ sed -e 's/deerit./&\n\n\n\n/' -e "s/locavit,/locavit --/" < new7.txt > new9.txt
155
156
test_expect_success 'ZEALOUS_ALNUM' '
157
157
- ! git merge-file -p new8.txt new5.txt new9.txt > merge.out &&
158
+ test_must_fail git merge-file -p \
159
+ new8.txt new5.txt new9.txt > merge.out &&
160
test 1 = $(grep ======= < merge.out | wc -l)
161
162
'
t/t6024-recursive-merge.sh
+4
-2
@@ -60,7 +60,9 @@ git update-index a1 &&
60
GIT_AUTHOR_DATE="2006-12-12 23:00:08" git commit -m F
61
'
62
63
-test_expect_success "combined merge conflicts" "! git merge -m final G"
63
+test_expect_success "combined merge conflicts" "
64
+ test_must_fail git merge -m final G
65
+"
66
67
cat > expect << EOF
68
<<<<<<< HEAD:a1
@@ -90,7 +92,7 @@ test_expect_success 'refuse to merge binary files' '
92
printf "\0\0" > binary-file &&
93
git add binary-file &&
94
git commit -m binary2 &&
93
- ! git merge F > merge.out 2> merge.err &&
95
+ test_must_fail git merge F > merge.out 2> merge.err &&
96
grep "Cannot merge binary files: HEAD:binary-file vs. F:binary-file" \
97
merge.err
98
'
t/t6025-merge-symlinks.sh
+3
-3
@@ -33,7 +33,7 @@ git-commit -m b-file'
33
test_expect_success \
34
'merge master into b-symlink, which has a different symbolic link' '
35
git-checkout b-symlink &&
36
-! git-merge master'
36
+test_must_fail git-merge master'
37
38
test_expect_success \
39
'the merge result must be a file' '
@@ -42,7 +42,7 @@ test -f symlink'
42
test_expect_success \
43
'merge master into b-file, which has a file instead of a symbolic link' '
44
git-reset --hard && git-checkout b-file &&
45
-! git-merge master'
45
+test_must_fail git-merge master'
46
47
test_expect_success \
48
'the merge result must be a file' '
@@ -52,7 +52,7 @@ test_expect_success \
52
'merge b-file, which has a file instead of a symbolic link, into master' '
53
git-reset --hard &&
54
git-checkout master &&
55
-! git-merge b-file'
55
+test_must_fail git-merge b-file'
56
57
test_expect_success \
58
'the merge result must be a file' '
t/t6101-rev-parse-parents.sh
+1
-1
@@ -26,7 +26,7 @@ test_expect_success 'final^1^1^1 = final^^^' "test $(git rev-parse final^1^1^1)
26
test_expect_success 'final^1^2' "test $(git rev-parse start2) = $(git rev-parse final^1^2)"
27
test_expect_success 'final^1^2 != final^1^1' "test $(git rev-parse final^1^2) != $(git rev-parse final^1^1)"
28
test_expect_success 'final^1^3 not valid' "if git rev-parse --verify final^1^3; then false; else :; fi"
29
-test_expect_success '--verify start2^1' '! git rev-parse --verify start2^1'
29
+test_expect_success '--verify start2^1' 'test_must_fail git rev-parse --verify start2^1'
30
test_expect_success '--verify start2^0' 'git rev-parse --verify start2^0'
31
32
test_expect_success 'repack for next test' 'git repack -a -d'
t/t7001-mv.sh
+2
-2
@@ -80,7 +80,7 @@ test_expect_success \
80
81
test_expect_success \
82
'do not move directory over existing directory' \
83
- 'mkdir path0 && mkdir path0/path2 && ! git mv path2 path0'
83
+ 'mkdir path0 && mkdir path0/path2 && test_must_fail git mv path2 path0'
84
85
test_expect_success \
86
'move into "."' \
@@ -149,7 +149,7 @@ test_expect_success 'absolute pathname outside should fail' '(
149
>sub/file &&
150
git add sub/file &&
151
152
- ! git mv sub "$out/out" &&
152
+ test_must_fail git mv sub "$out/out" &&
153
test -d sub &&
154
! test -d ../in &&
155
git ls-files --error-unmatch sub/file
t/t7004-tag.sh
+35
-32
@@ -30,17 +30,17 @@ test_expect_success 'looking for a tag in an empty tree should fail' \
30
'! (tag_exists mytag)'
31
32
test_expect_success 'creating a tag in an empty tree should fail' '
33
- ! git-tag mynotag &&
33
+ test_must_fail git-tag mynotag &&
34
! tag_exists mynotag
35
'
36
37
test_expect_success 'creating a tag for HEAD in an empty tree should fail' '
38
- ! git-tag mytaghead HEAD &&
38
+ test_must_fail git-tag mytaghead HEAD &&
39
! tag_exists mytaghead
40
'
41
42
test_expect_success 'creating a tag for an unknown revision should fail' '
43
- ! git-tag mytagnorev aaaaaaaaaaa &&
43
+ test_must_fail git-tag mytagnorev aaaaaaaaaaa &&
44
! tag_exists mytagnorev
45
'
46
@@ -85,16 +85,16 @@ test_expect_success \
85
86
test_expect_success \
87
'trying to create a tag with the name of one existing should fail' \
88
- '! git tag mytag'
88
+ 'test_must_fail git tag mytag'
89
90
test_expect_success \
91
'trying to create a tag with a non-valid name should fail' '
92
test `git-tag -l | wc -l` -eq 1 &&
93
- ! git tag "" &&
94
- ! git tag .othertag &&
95
- ! git tag "other tag" &&
96
- ! git tag "othertag^" &&
97
- ! git tag "other~tag" &&
93
+ test_must_fail git tag "" &&
94
+ test_must_fail git tag .othertag &&
95
+ test_must_fail git tag "other tag" &&
96
+ test_must_fail git tag "othertag^" &&
97
+ test_must_fail git tag "other~tag" &&
98
test `git-tag -l | wc -l` -eq 1
99
'
100
@@ -107,7 +107,7 @@ test_expect_success 'creating a tag using HEAD directly should succeed' '
107
108
test_expect_success 'trying to delete an unknown tag should fail' '
109
! tag_exists unknown-tag &&
110
- ! git-tag -d unknown-tag
110
+ test_must_fail git-tag -d unknown-tag
111
'
112
113
cat >expect <<EOF
@@ -141,13 +141,13 @@ test_expect_success \
141
'trying to delete two tags, existing and not, should fail in the 2nd' '
142
tag_exists mytag &&
143
! tag_exists myhead &&
144
- ! git-tag -d mytag anothertag &&
144
+ test_must_fail git-tag -d mytag anothertag &&
145
! tag_exists mytag &&
146
! tag_exists myhead
147
'
148
149
test_expect_success 'trying to delete an already deleted tag should fail' \
150
- '! git-tag -d mytag'
150
+ 'test_must_fail git-tag -d mytag'
151
152
# listing various tags with pattern matching:
153
@@ -266,15 +266,15 @@ test_expect_success \
266
'
267
268
test_expect_success 'trying to verify an unknown tag should fail' \
269
- '! git-tag -v unknown-tag'
269
+ 'test_must_fail git-tag -v unknown-tag'
270
271
test_expect_success \
272
'trying to verify a non-annotated and non-signed tag should fail' \
273
- '! git-tag -v non-annotated-tag'
273
+ 'test_must_fail git-tag -v non-annotated-tag'
274
275
test_expect_success \
276
'trying to verify many non-annotated or unknown tags, should fail' \
277
- '! git-tag -v unknown-tag1 non-annotated-tag unknown-tag2'
277
+ 'test_must_fail git-tag -v unknown-tag1 non-annotated-tag unknown-tag2'
278
279
# creating annotated tags:
280
@@ -334,7 +334,7 @@ test_expect_success \
334
'trying to create a tag with a non-existing -F file should fail' '
335
! test -f nonexistingfile &&
336
! tag_exists notag &&
337
- ! git-tag -F nonexistingfile notag &&
337
+ test_must_fail git-tag -F nonexistingfile notag &&
338
! tag_exists notag
339
'
340
@@ -343,11 +343,12 @@ test_expect_success \
343
echo "message file 1" >msgfile1 &&
344
echo "message file 2" >msgfile2 &&
345
! tag_exists msgtag &&
346
- ! git-tag -m "message 1" -F msgfile1 msgtag &&
346
+ test_must_fail git-tag -m "message 1" -F msgfile1 msgtag &&
347
! tag_exists msgtag &&
348
- ! git-tag -F msgfile1 -m "message 1" msgtag &&
348
+ test_must_fail git-tag -F msgfile1 -m "message 1" msgtag &&
349
! tag_exists msgtag &&
350
- ! git-tag -m "message 1" -F msgfile1 -m "message 2" msgtag &&
350
+ test_must_fail git-tag -m "message 1" -F msgfile1 \
351
+ -m "message 2" msgtag &&
352
! tag_exists msgtag
353
'
354
@@ -591,19 +592,19 @@ fi
592
test_expect_success \
593
'trying to verify an annotated non-signed tag should fail' '
594
tag_exists annotated-tag &&
594
- ! git-tag -v annotated-tag
595
+ test_must_fail git-tag -v annotated-tag
596
'
597
598
test_expect_success \
599
'trying to verify a file-annotated non-signed tag should fail' '
600
tag_exists file-annotated-tag &&
600
- ! git-tag -v file-annotated-tag
601
+ test_must_fail git-tag -v file-annotated-tag
602
'
603
604
test_expect_success \
605
'trying to verify two annotated non-signed tags should fail' '
606
tag_exists annotated-tag file-annotated-tag &&
606
- ! git-tag -v annotated-tag file-annotated-tag
607
+ test_must_fail git-tag -v annotated-tag file-annotated-tag
608
'
609
610
# creating and verifying signed tags:
@@ -651,13 +652,14 @@ test_expect_success 'sign with a given key id' '
652
653
test_expect_success 'sign with an unknown id (1)' '
654
654
- ! git tag -u author@example.com -m "Another message" o-signed-tag
655
+ test_must_fail git tag -u author@example.com \
656
+ -m "Another message" o-signed-tag
657
658
'
659
660
test_expect_success 'sign with an unknown id (2)' '
661
660
- ! git tag -u DEADBEEF -m "Another message" o-signed-tag
662
+ test_must_fail git tag -u DEADBEEF -m "Another message" o-signed-tag
663
664
'
665
@@ -718,7 +720,7 @@ test_expect_success \
720
'trying to create a signed tag with non-existing -F file should fail' '
721
! test -f nonexistingfile &&
722
! tag_exists nosigtag &&
721
- ! git-tag -s -F nonexistingfile nosigtag &&
723
+ test_must_fail git-tag -s -F nonexistingfile nosigtag &&
724
! tag_exists nosigtag
725
'
726
@@ -730,10 +732,11 @@ test_expect_success 'verifying two signed tags in one command should succeed' \
732
733
test_expect_success \
734
'verifying many signed and non-signed tags should fail' '
733
- ! git-tag -v signed-tag annotated-tag &&
734
- ! git-tag -v file-annotated-tag file-signed-tag &&
735
- ! git-tag -v annotated-tag file-signed-tag file-annotated-tag &&
736
- ! git-tag -v signed-tag annotated-tag file-signed-tag
735
+ test_must_fail git-tag -v signed-tag annotated-tag &&
736
+ test_must_fail git-tag -v file-annotated-tag file-signed-tag &&
737
+ test_must_fail git-tag -v annotated-tag \
738
+ file-signed-tag file-annotated-tag &&
739
+ test_must_fail git-tag -v signed-tag annotated-tag file-signed-tag
740
'
741
742
test_expect_success 'verifying a forged tag should fail' '
@@ -741,7 +744,7 @@ test_expect_success 'verifying a forged tag should fail' '
744
sed -e "s/signed-tag/forged-tag/" |
745
git mktag) &&
746
git tag forged-tag $forged &&
744
- ! git-tag -v forged-tag
747
+ test_must_fail git-tag -v forged-tag
748
'
749
750
# blank and empty messages for signed tags:
@@ -1031,7 +1034,7 @@ test_expect_success \
1034
git config user.signingkey BobTheMouse
1035
test_expect_success \
1036
'git-tag -s fails if gpg is misconfigured' \
1034
- '! git tag -s -m tail tag-gpg-failure'
1037
+ 'test_must_fail git tag -s -m tail tag-gpg-failure'
1038
git config --unset user.signingkey
1039
1040
# try to verify without gpg:
@@ -1039,7 +1042,7 @@ git config --unset user.signingkey
1042
rm -rf gpghome
1043
test_expect_success \
1044
'verify signed tag fails when public key is not present' \
1042
- '! git-tag -v signed-tag'
1045
+ 'test_must_fail git-tag -v signed-tag'
1046
1047
test_expect_success \
1048
'git-tag -a fails if tag annotation is empty' '
t/t7102-reset.sh
+24
-24
@@ -52,10 +52,10 @@ secondfile:
52
EOF
53
54
test_expect_success 'giving a non existing revision should fail' '
55
- ! git reset aaaaaa &&
56
- ! git reset --mixed aaaaaa &&
57
- ! git reset --soft aaaaaa &&
58
- ! git reset --hard aaaaaa &&
55
+ test_must_fail git reset aaaaaa &&
56
+ test_must_fail git reset --mixed aaaaaa &&
57
+ test_must_fail git reset --soft aaaaaa &&
58
+ test_must_fail git reset --hard aaaaaa &&
59
check_changes 3ec39651e7f44ea531a5de18a9fa791c0fd370fc
60
'
61
@@ -63,29 +63,29 @@ test_expect_success 'reset --soft with unmerged index should fail' '
63
touch .git/MERGE_HEAD &&
64
echo "100644 44c5b5884550c17758737edcced463447b91d42b 1 un" |
65
git update-index --index-info &&
66
- ! git reset --soft HEAD &&
66
+ test_must_fail git reset --soft HEAD &&
67
rm .git/MERGE_HEAD &&
68
git rm --cached -- un
69
'
70
71
test_expect_success \
72
'giving paths with options different than --mixed should fail' '
73
- ! git reset --soft -- first &&
74
- ! git reset --hard -- first &&
75
- ! git reset --soft HEAD^ -- first &&
76
- ! git reset --hard HEAD^ -- first &&
73
+ test_must_fail git reset --soft -- first &&
74
+ test_must_fail git reset --hard -- first &&
75
+ test_must_fail git reset --soft HEAD^ -- first &&
76
+ test_must_fail git reset --hard HEAD^ -- first &&
77
check_changes 3ec39651e7f44ea531a5de18a9fa791c0fd370fc
78
'
79
80
test_expect_success 'giving unrecognized options should fail' '
81
- ! git reset --other &&
82
- ! git reset -o &&
83
- ! git reset --mixed --other &&
84
- ! git reset --mixed -o &&
85
- ! git reset --soft --other &&
86
- ! git reset --soft -o &&
87
- ! git reset --hard --other &&
88
- ! git reset --hard -o &&
81
+ test_must_fail git reset --other &&
82
+ test_must_fail git reset -o &&
83
+ test_must_fail git reset --mixed --other &&
84
+ test_must_fail git reset --mixed -o &&
85
+ test_must_fail git reset --soft --other &&
86
+ test_must_fail git reset --soft -o &&
87
+ test_must_fail git reset --hard --other &&
88
+ test_must_fail git reset --hard -o &&
89
check_changes 3ec39651e7f44ea531a5de18a9fa791c0fd370fc
90
'
91
@@ -102,8 +102,8 @@ test_expect_success \
102
echo "3rd line in branch2" >>secondfile &&
103
git commit -a -m "change in branch2" &&
104
105
- ! git merge branch1 &&
106
- ! git reset --soft &&
105
+ test_must_fail git merge branch1 &&
106
+ test_must_fail git reset --soft &&
107
108
printf "1st line 2nd file\n2nd line 2nd file\n3rd line" >secondfile &&
109
git commit -a -m "the change in branch2" &&
@@ -126,7 +126,7 @@ test_expect_success \
126
echo "3rd line in branch4" >>secondfile &&
127
128
git checkout -m branch3 &&
129
- ! git reset --soft &&
129
+ test_must_fail git reset --soft &&
130
131
printf "1st line 2nd file\n2nd line 2nd file\n3rd line" >secondfile &&
132
git commit -a -m "the line in branch3" &&
@@ -326,7 +326,7 @@ test_expect_success '--hard reset to HEAD should clear a failed merge' '
326
echo "3rd line in branch2" >>secondfile &&
327
git commit -a -m "change in branch2" &&
328
329
- ! git pull . branch1 &&
329
+ test_must_fail git pull . branch1 &&
330
git reset --hard &&
331
check_changes 77abb337073fb4369a7ad69ff6f5ec0e4d6b54bb
332
'
@@ -388,7 +388,7 @@ test_expect_success 'test --mixed <paths>' '
388
echo 4 > file4 &&
389
echo 5 > file1 &&
390
git add file1 file3 file4 &&
391
- ! git reset HEAD -- file1 file2 file3 &&
391
+ test_must_fail git reset HEAD -- file1 file2 file3 &&
392
git diff > output &&
393
test_cmp output expect &&
394
git diff --cached > output &&
@@ -402,11 +402,11 @@ test_expect_success 'test resetting the index at give paths' '
402
>sub/file2 &&
403
git update-index --add sub/file1 sub/file2 &&
404
T=$(git write-tree) &&
405
- ! git reset HEAD sub/file2 &&
405
+ test_must_fail git reset HEAD sub/file2 &&
406
U=$(git write-tree) &&
407
echo "$T" &&
408
echo "$U" &&
409
- ! git diff-index --cached --exit-code "$T" &&
409
+ test_must_fail git diff-index --cached --exit-code "$T" &&
410
test "$T" != "$U"
411
412
'
t/t7103-reset-bare.sh
+1
-1
@@ -17,7 +17,7 @@ test_expect_success 'setup bare' '
17
'
18
19
test_expect_success 'hard reset is not allowed' '
20
- ! git reset --hard HEAD^
20
+ test_must_fail git reset --hard HEAD^
21
'
22
23
test_expect_success 'soft reset is allowed' '
t/t7300-clean.sh
+2
-2
@@ -316,14 +316,14 @@ test_expect_success 'git-clean -d -X' '
316
test_expect_success 'clean.requireForce defaults to true' '
317
318
git config --unset clean.requireForce &&
319
- ! git-clean
319
+ test_must_fail git clean
320
321
'
322
323
test_expect_success 'clean.requireForce' '
324
325
git config clean.requireForce true &&
326
- ! git-clean
326
+ test_must_fail git clean
327
328
'
329
t/t7400-submodule-basic.sh
+1
-1
@@ -75,7 +75,7 @@ test_expect_success 'init should register submodule url in .git/config' '
75
then
76
echo "[OOPS] init succeeded but submodule url is wrong"
77
false
78
- elif ! git config submodule.example.url ./.subrepo
78
+ elif test_must_fail git config submodule.example.url ./.subrepo
79
then
80
echo "[OOPS] init succeeded but update of url failed"
81
false
t/t7402-submodule-rebase.sh
+1
-1
@@ -71,7 +71,7 @@ test_expect_success 'rebase with dirty file and submodule fails' '
71
test_tick &&
72
git commit -m rewrite file &&
73
echo dirty > file &&
74
- ! git rebase --onto HEAD~2 HEAD^
74
+ test_must_fail git rebase --onto HEAD~2 HEAD^
75
76
'
77
t/t7500-commit.sh
+4
-4
@@ -23,12 +23,12 @@ test_expect_success 'a basic commit in an empty tree should succeed' '
23
test_expect_success 'nonexistent template file should return error' '
24
echo changes >> foo &&
25
git add foo &&
26
- ! git commit --template "$PWD"/notexist
26
+ test_must_fail git commit --template "$PWD"/notexist
27
'
28
29
test_expect_success 'nonexistent template file in config should return error' '
30
git config commit.template "$PWD"/notexist &&
31
- ! git commit &&
31
+ test_must_fail git commit &&
32
git config --unset commit.template
33
'
34
@@ -37,12 +37,12 @@ TEMPLATE="$PWD"/template
37
38
test_expect_success 'unedited template should not commit' '
39
echo "template line" > "$TEMPLATE" &&
40
- ! git commit --template "$TEMPLATE"
40
+ test_must_fail git commit --template "$TEMPLATE"
41
'
42
43
test_expect_success 'unedited template with comments should not commit' '
44
echo "# comment in template" >> "$TEMPLATE" &&
45
- ! git commit --template "$TEMPLATE"
45
+ test_must_fail git commit --template "$TEMPLATE"
46
'
47
48
test_expect_success 'a Signed-off-by line by itself should not commit' '
t/t7501-commit.sh
+9
-9
@@ -19,7 +19,7 @@ test_expect_success \
19
20
test_expect_success \
21
"fail initial amend" \
22
- "! git-commit --amend"
22
+ "test_must_fail git-commit --amend"
23
24
test_expect_success \
25
"initial commit" \
@@ -27,16 +27,16 @@ test_expect_success \
27
28
test_expect_success \
29
"invalid options 1" \
30
- "! git-commit -m foo -m bar -F file"
30
+ "test_must_fail git-commit -m foo -m bar -F file"
31
32
test_expect_success \
33
"invalid options 2" \
34
- "! git-commit -C HEAD -m illegal"
34
+ "test_must_fail git-commit -C HEAD -m illegal"
35
36
test_expect_success \
37
"using paths with -a" \
38
"echo King of the bongo >file &&
39
- ! git-commit -m foo -a file"
39
+ test_must_fail git-commit -m foo -a file"
40
41
test_expect_success \
42
"using paths with --interactive" \
@@ -45,11 +45,11 @@ test_expect_success \
45
46
test_expect_success \
47
"using invalid commit with -C" \
48
- "! git-commit -C bogus"
48
+ "test_must_fail git-commit -C bogus"
49
50
test_expect_success \
51
"testing nothing to commit" \
52
- "! git-commit -m initial"
52
+ "test_must_fail git-commit -m initial"
53
54
test_expect_success \
55
"next commit" \
@@ -59,7 +59,7 @@ test_expect_success \
59
test_expect_success \
60
"commit message from non-existing file" \
61
"echo 'more bongo: bongo bongo bongo bongo' >file && \
62
- ! git-commit -F gah -a"
62
+ test_must_fail git-commit -F gah -a"
63
64
# Empty except stray tabs and spaces on a few lines.
65
sed -e 's/@$//' >msg <<EOF
@@ -70,7 +70,7 @@ Signed-off-by: hula
70
EOF
71
test_expect_success \
72
"empty commit message" \
73
- "! git-commit -F msg -a"
73
+ "test_must_fail git-commit -F msg -a"
74
75
test_expect_success \
76
"commit message from file" \
@@ -91,7 +91,7 @@ test_expect_success \
91
test_expect_success \
92
"passing -m and -F" \
93
"echo 'enough with the bongos' >file && \
94
- ! git-commit -F msg -m amending ."
94
+ test_must_fail git-commit -F msg -m amending ."
95
96
test_expect_success \
97
"using message from other commit" \
t/t7503-pre-commit-hook.sh
+1
-1
@@ -56,7 +56,7 @@ test_expect_success 'with failing hook' '
56
57
echo "another" >> file &&
58
git add file &&
59
- ! git commit -m "another"
59
+ test_must_fail git commit -m "another"
60
61
'
62
t/t7504-commit-msg-hook.sh
+1
-1
@@ -105,7 +105,7 @@ test_expect_success 'with failing hook' '
105
106
echo "another" >> file &&
107
git add file &&
108
- ! git commit -m "another"
108
+ test_must_fail git commit -m "another"
109
110
'
111
t/t7600-merge.sh
+1
-1
@@ -126,7 +126,7 @@ verify_merge() {
126
echo "[OOPS] unmerged files"
127
false
128
fi &&
129
- if ! git diff --exit-code
129
+ if test_must_fail git diff --exit-code
130
then
131
echo "[OOPS] working tree != index"
132
false
t/t7610-mergetool.sh
+1
-1
@@ -35,7 +35,7 @@ test_expect_success 'custom mergetool' '
35
git config mergetool.mytool.cmd "cat \"\$REMOTE\" >\"\$MERGED\"" &&
36
git config mergetool.mytool.trustExitCode true &&
37
git checkout branch1 &&
38
- ! git merge master >/dev/null 2>&1 &&
38
+ test_must_fail git merge master >/dev/null 2>&1 &&
39
( yes "" | git mergetool file1>/dev/null 2>&1 ) &&
40
( yes "" | git mergetool file2>/dev/null 2>&1 ) &&
41
test "$(cat file1)" = "master updated" &&
t/t9001-send-email.sh
+1
-1
@@ -91,7 +91,7 @@ test_expect_success 'reject long lines' '
91
clean_fake_sendmail &&
92
cp $patches longline.patch &&
93
echo $z512$z512 >>longline.patch &&
94
- ! git send-email \
94
+ test_must_fail git send-email \
95
--from="Example <nobody@example.com>" \
96
--to=nobody@example.com \
97
--smtp-server="$(pwd)/fake.sendmail" \
t/t9100-git-svn-basic.sh
+6
-6
@@ -63,7 +63,7 @@ test_expect_success "$name" "
63
git update-index --remove dir/file &&
64
git update-index --add dir/file/file &&
65
git commit -m '$name' &&
66
- ! git-svn set-tree --find-copies-harder --rmdir \
66
+ test_must_fail git-svn set-tree --find-copies-harder --rmdir \
67
remotes/git-svn..mybranch" || true
68
69
@@ -77,7 +77,7 @@ test_expect_success "$name" '
77
git update-index --remove -- bar/zzz &&
78
git update-index --add -- bar &&
79
git commit -m "$name" &&
80
- ! git-svn set-tree --find-copies-harder --rmdir \
80
+ test_must_fail git-svn set-tree --find-copies-harder --rmdir \
81
remotes/git-svn..mybranch2' || true
82
83
@@ -91,7 +91,7 @@ test_expect_success "$name" '
91
echo yyy > bar/zzz/yyy &&
92
git update-index --add bar/zzz/yyy &&
93
git commit -m "$name" &&
94
- ! git-svn set-tree --find-copies-harder --rmdir \
94
+ test_must_fail git-svn set-tree --find-copies-harder --rmdir \
95
remotes/git-svn..mybranch3' || true
96
97
@@ -105,7 +105,7 @@ test_expect_success "$name" '
105
echo asdf > dir &&
106
git update-index --add -- dir &&
107
git commit -m "$name" &&
108
- ! git-svn set-tree --find-copies-harder --rmdir \
108
+ test_must_fail git-svn set-tree --find-copies-harder --rmdir \
109
remotes/git-svn..mybranch4' || true
110
111
@@ -216,7 +216,7 @@ test_expect_success "$name" "test_cmp a expected"
216
test_expect_success 'exit if remote refs are ambigious' "
217
git config --add svn-remote.svn.fetch \
218
bar:refs/remotes/git-svn &&
219
- ! git-svn migrate
219
+ test_must_fail git-svn migrate
220
"
221
222
test_expect_success 'exit if init-ing a would clobber a URL' '
@@ -224,7 +224,7 @@ test_expect_success 'exit if init-ing a would clobber a URL' '
224
svn mkdir -m "mkdir bar" "${svnrepo}2/bar" &&
225
git config --unset svn-remote.svn.fetch \
226
"^bar:refs/remotes/git-svn$" &&
227
- ! git-svn init "${svnrepo}2/bar"
227
+ test_must_fail git-svn init "${svnrepo}2/bar"
228
'
229
230
test_expect_success \
t/t9106-git-svn-commit-diff-clobber.sh
+3
-3
@@ -27,7 +27,7 @@ test_expect_success 'commit change from svn side' '
27
test_expect_success 'commit conflicting change from git' '
28
echo second line from git >> file &&
29
git commit -a -m "second line from git" &&
30
- ! git-svn commit-diff -r1 HEAD~1 HEAD "$svnrepo"
30
+ test_must_fail git-svn commit-diff -r1 HEAD~1 HEAD "$svnrepo"
31
'
32
33
test_expect_success 'commit complementing change from git' '
@@ -52,7 +52,7 @@ test_expect_success 'dcommit fails to commit because of conflict' '
52
rm -rf t.svn &&
53
echo "fourth line from git" >> file &&
54
git commit -a -m "fourth line from git" &&
55
- ! git-svn dcommit
55
+ test_must_fail git-svn dcommit
56
'
57
58
test_expect_success 'dcommit does the svn equivalent of an index merge' "
@@ -83,7 +83,7 @@ test_expect_success 'multiple dcommit from git-svn will not clobber svn' "
83
git commit -a -m 'new file' &&
84
echo clobber > file &&
85
git commit -a -m 'clobber' &&
86
- ! git svn dcommit
86
+ test_must_fail git svn dcommit
87
"
88
89
t/t9106-git-svn-dcommit-clobber-series.sh
+1
-1
@@ -57,7 +57,7 @@ test_expect_success 'change file but in unrelated area' "
57
test_expect_success 'attempt to dcommit with a dirty index' '
58
echo foo >>file &&
59
git add file &&
60
- ! git svn dcommit
60
+ test_must_fail git svn dcommit
61
'
62
63
test_done
t/t9200-git-cvsexportcommit.sh
+3
-3
@@ -100,7 +100,7 @@ test_expect_success \
100
git commit -a -m "generation 2" &&
101
id=$(git rev-list --max-count=1 HEAD) &&
102
(cd "$CVSWORK" &&
103
- ! git cvsexportcommit -c $id
103
+ test_must_fail git cvsexportcommit -c $id
104
)'
105
106
#test_expect_success \
@@ -112,7 +112,7 @@ test_expect_success \
112
# git commit -a -m "generation 3" &&
113
# id=$(git rev-list --max-count=1 HEAD) &&
114
# (cd "$CVSWORK" &&
115
-# ! git cvsexportcommit -c $id
115
+# test_must_fail git cvsexportcommit -c $id
116
# )'
117
118
# We reuse the state from two tests back here
@@ -222,7 +222,7 @@ test_expect_success \
222
git commit -a -m "Update two" &&
223
id=$(git rev-list --max-count=1 HEAD) &&
224
(cd "$CVSWORK" &&
225
- ! git-cvsexportcommit -c $id
225
+ test_must_fail git-cvsexportcommit -c $id
226
)'
227
228
case "$(git config --bool core.filemode)" in
t/t9300-fast-import.sh
+4
-4
@@ -166,7 +166,7 @@ M 755 0000000000000000000000000000000000000001 zero1
166
167
INPUT_END
168
test_expect_success 'B: fail on invalid blob sha1' '
169
- ! git-fast-import <input
169
+ test_must_fail git-fast-import <input
170
'
171
rm -f .git/objects/pack_* .git/objects/index_*
172
@@ -181,7 +181,7 @@ from refs/heads/master
181
182
INPUT_END
183
test_expect_success 'B: fail on invalid branch name ".badbranchname"' '
184
- ! git-fast-import <input
184
+ test_must_fail git-fast-import <input
185
'
186
rm -f .git/objects/pack_* .git/objects/index_*
187
@@ -196,7 +196,7 @@ from refs/heads/master
196
197
INPUT_END
198
test_expect_success 'B: fail on invalid branch name "bad[branch]name"' '
199
- ! git-fast-import <input
199
+ test_must_fail git-fast-import <input
200
'
201
rm -f .git/objects/pack_* .git/objects/index_*
202
@@ -340,7 +340,7 @@ from refs/heads/branch^0
340
341
INPUT_END
342
test_expect_success 'E: rfc2822 date, --date-format=raw' '
343
- ! git-fast-import --date-format=raw <input
343
+ test_must_fail git-fast-import --date-format=raw <input
344
'
345
test_expect_success \
346
'E: rfc2822 date, --date-format=rfc2822' \
t/t9301-fast-export.sh
+2
-2
@@ -59,7 +59,7 @@ test_expect_success 'fast-export master~2..master' '
59
test $MASTER != $(git rev-parse --verify refs/heads/partial) &&
60
git diff master..partial &&
61
git diff master^..partial^ &&
62
- ! git rev-parse partial~2)
62
+ test_must_fail git rev-parse partial~2)
63
64
'
65
@@ -125,7 +125,7 @@ test_expect_success 'set up faked signed tag' '
125
126
test_expect_success 'signed-tags=abort' '
127
128
- ! git fast-export --signed-tags=abort sign-your-name
128
+ test_must_fail git fast-export --signed-tags=abort sign-your-name
129
130
'
131