Convert "! git" to "test_must_fail git"
test_must_fail will account for segfaults in git, so it should be used instead of "! git" This patch does not change any of the commands that use pipes. Signed-off-by: Jared Hance <jaredhance@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jared Hance committed
Jul 20, 2010 at 19:18 UTC
ce14e0b264b31dd02a0c9d1688bceb6579d052fa
11 files changed
+26
-26
t/t1001-read-tree-m-2way.sh
+1
-1
@@ -359,7 +359,7 @@ test_expect_success \
359
360
test_expect_success \
361
'a/b (untracked) vs a, plus c/d case test.' \
362
- '! git read-tree -u -m "$treeH" "$treeM" &&
362
+ 'test_must_fail git read-tree -u -m "$treeH" "$treeM" &&
363
git ls-files --stage &&
364
test -f a/b'
365
t/t3301-notes.sh
+3
-3
@@ -299,7 +299,7 @@ cat expect-F >> expect-rm-F
299
test_expect_success 'verify note removal with -F /dev/null' '
300
git log -4 > output &&
301
test_cmp expect-rm-F output &&
302
- ! git notes show
302
+ test_must_fail git notes show
303
'
304
305
test_expect_success 'do not create empty note with -m "" (setup)' '
@@ -309,7 +309,7 @@ test_expect_success 'do not create empty note with -m "" (setup)' '
309
test_expect_success 'verify non-creation of note with -m ""' '
310
git log -4 > output &&
311
test_cmp expect-rm-F output &&
312
- ! git notes show
312
+ test_must_fail git notes show
313
'
314
315
cat > expect-combine_m_and_F << EOF
@@ -357,7 +357,7 @@ cat expect-multiline >> expect-rm-remove
357
test_expect_success 'verify note removal with "git notes remove"' '
358
git log -4 > output &&
359
test_cmp expect-rm-remove output &&
360
- ! git notes show HEAD^
360
+ test_must_fail git notes show HEAD^
361
'
362
363
cat > expect << EOF
t/t3306-notes-prune.sh
+4
-4
@@ -67,7 +67,7 @@ test_expect_success 'remove some commits' '
67
68
test_expect_success 'verify that commits are gone' '
69
70
- ! git cat-file -p 5ee1c35e83ea47cd3cc4f8cbee0568915fbbbd29 &&
70
+ test_must_fail git cat-file -p 5ee1c35e83ea47cd3cc4f8cbee0568915fbbbd29 &&
71
git cat-file -p 08341ad9e94faa089d60fd3f523affb25c6da189 &&
72
git cat-file -p ab5f302035f2e7aaf04265f08b42034c23256e1f
73
'
@@ -106,7 +106,7 @@ test_expect_success 'prune notes' '
106
107
test_expect_success 'verify that notes are gone' '
108
109
- ! git notes show 5ee1c35e83ea47cd3cc4f8cbee0568915fbbbd29 &&
109
+ test_must_fail git notes show 5ee1c35e83ea47cd3cc4f8cbee0568915fbbbd29 &&
110
git notes show 08341ad9e94faa089d60fd3f523affb25c6da189 &&
111
git notes show ab5f302035f2e7aaf04265f08b42034c23256e1f
112
'
@@ -130,8 +130,8 @@ test_expect_success 'prune -v notes' '
130
131
test_expect_success 'verify that notes are gone' '
132
133
- ! git notes show 5ee1c35e83ea47cd3cc4f8cbee0568915fbbbd29 &&
134
- ! git notes show 08341ad9e94faa089d60fd3f523affb25c6da189 &&
133
+ test_must_fail git notes show 5ee1c35e83ea47cd3cc4f8cbee0568915fbbbd29 &&
134
+ test_must_fail git notes show 08341ad9e94faa089d60fd3f523affb25c6da189 &&
135
git notes show ab5f302035f2e7aaf04265f08b42034c23256e1f
136
'
137
t/t3410-rebase-preserve-dropped-merges.sh
+4
-4
@@ -43,11 +43,11 @@ test_expect_success 'setup' '
43
# G2 = same changes as G
44
test_expect_success 'skip same-resolution merges with -p' '
45
git checkout H &&
46
- ! git merge E &&
46
+ test_must_fail git merge E &&
47
test_commit L file1 23 &&
48
git checkout I &&
49
test_commit G2 file1 3 &&
50
- ! git merge E &&
50
+ test_must_fail git merge E &&
51
test_commit J file1 23 &&
52
test_commit K file7 file7 &&
53
git rebase -i -p L &&
@@ -65,11 +65,11 @@ test_expect_success 'skip same-resolution merges with -p' '
65
# G2 = different changes as G
66
test_expect_success 'keep different-resolution merges with -p' '
67
git checkout H &&
68
- ! git merge E &&
68
+ test_must_fail git merge E &&
69
test_commit L2 file1 23 &&
70
git checkout I &&
71
test_commit G3 file1 4 &&
72
- ! git merge E &&
72
+ test_must_fail git merge E &&
73
test_commit J2 file1 24 &&
74
test_commit K2 file7 file7 &&
75
test_must_fail git rebase -i -p L2 &&
t/t6037-merge-ours-theirs.sh
+1
-1
@@ -58,7 +58,7 @@ test_expect_success 'pull with -X' '
58
git reset --hard master && git pull -s recursive -X ours . side &&
59
git reset --hard master && git pull -s recursive -Xtheirs . side &&
60
git reset --hard master && git pull -s recursive -X theirs . side &&
61
- git reset --hard master && ! git pull -s recursive -X bork . side
61
+ git reset --hard master && test_must_fail git pull -s recursive -X bork . side
62
'
63
64
test_done
t/t7509-commit.sh
+2
-2
@@ -111,7 +111,7 @@ test_expect_success '--amend option with empty author' '
111
test_when_finished "git checkout Initial" &&
112
echo "Empty author test" >>foo &&
113
test_tick &&
114
- ! git commit -a -m "empty author" --amend 2>err &&
114
+ test_must_fail git commit -a -m "empty author" --amend 2>err &&
115
grep "empty ident" err
116
'
117
@@ -125,7 +125,7 @@ test_expect_success '--amend option with missing author' '
125
test_when_finished "git checkout Initial" &&
126
echo "Missing author test" >>foo &&
127
test_tick &&
128
- ! git commit -a -m "malformed author" --amend 2>err &&
128
+ test_must_fail git commit -a -m "malformed author" --amend 2>err &&
129
grep "empty ident" err
130
'
131
t/t7607-merge-overwrite.sh
+6
-6
@@ -31,7 +31,7 @@ test_expect_success 'setup' '
31
test_expect_success 'will not overwrite untracked file' '
32
git reset --hard c1 &&
33
cat important > c2.c &&
34
- ! git merge c2 &&
34
+ test_must_fail git merge c2 &&
35
test_cmp important c2.c
36
'
37
@@ -39,7 +39,7 @@ test_expect_success 'will not overwrite new file' '
39
git reset --hard c1 &&
40
cat important > c2.c &&
41
git add c2.c &&
42
- ! git merge c2 &&
42
+ test_must_fail git merge c2 &&
43
test_cmp important c2.c
44
'
45
@@ -48,7 +48,7 @@ test_expect_success 'will not overwrite staged changes' '
48
cat important > c2.c &&
49
git add c2.c &&
50
rm c2.c &&
51
- ! git merge c2 &&
51
+ test_must_fail git merge c2 &&
52
git checkout c2.c &&
53
test_cmp important c2.c
54
'
@@ -58,7 +58,7 @@ test_expect_success 'will not overwrite removed file' '
58
git rm c1.c &&
59
git commit -m "rm c1.c" &&
60
cat important > c1.c &&
61
- ! git merge c1a &&
61
+ test_must_fail git merge c1a &&
62
test_cmp important c1.c
63
'
64
@@ -68,7 +68,7 @@ test_expect_success 'will not overwrite re-added file' '
68
git commit -m "rm c1.c" &&
69
cat important > c1.c &&
70
git add c1.c &&
71
- ! git merge c1a &&
71
+ test_must_fail git merge c1a &&
72
test_cmp important c1.c
73
'
74
@@ -79,7 +79,7 @@ test_expect_success 'will not overwrite removed file with staged changes' '
79
cat important > c1.c &&
80
git add c1.c &&
81
rm c1.c &&
82
- ! git merge c1a &&
82
+ test_must_fail git merge c1a &&
83
git checkout c1.c &&
84
test_cmp important c1.c
85
'
t/t7810-grep.sh
+1
-1
@@ -65,7 +65,7 @@ do
65
66
test_expect_success "grep -w $L (w)" '
67
: >expected &&
68
- ! git grep -n -w -e "^w" >actual &&
68
+ test_must_fail git grep -n -w -e "^w" >actual &&
69
test_cmp expected actual
70
'
71
t/t9130-git-svn-authors-file.sh
+2
-2
@@ -20,7 +20,7 @@ test_expect_success 'setup svnrepo' '
20
'
21
22
test_expect_success 'start import with incomplete authors file' '
23
- ! git svn clone --authors-file=svn-authors "$svnrepo" x
23
+ test_must_fail git svn clone --authors-file=svn-authors "$svnrepo" x
24
'
25
26
test_expect_success 'imported 2 revisions successfully' '
@@ -63,7 +63,7 @@ test_expect_success 'authors-file against globs' '
63
'
64
65
test_expect_success 'fetch fails on ee' '
66
- ( cd aa-work && ! git svn fetch --authors-file=../svn-authors )
66
+ ( cd aa-work && test_must_fail git svn fetch --authors-file=../svn-authors )
67
'
68
69
tmp_config_get () {
t/t9139-git-svn-non-utf8-commitencoding.sh
+1
-1
@@ -39,7 +39,7 @@ do
39
(
40
cd $H &&
41
git config --unset i18n.commitencoding &&
42
- ! git svn dcommit
42
+ test_must_fail git svn dcommit
43
)
44
'
45
done
t/t9140-git-svn-reset.sh
+1
-1
@@ -41,7 +41,7 @@ test_expect_success 'modify hidden file in SVN repo' '
41
test_expect_success 'fetch fails on modified hidden file' '
42
( cd g &&
43
git svn find-rev refs/remotes/git-svn > ../expect &&
44
- ! git svn fetch 2> ../errors &&
44
+ test_must_fail git svn fetch 2> ../errors &&
45
git svn find-rev refs/remotes/git-svn > ../expect2 ) &&
46
fgrep "not found in commit" errors &&
47
test_cmp expect expect2