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>
This commit is contained in:

committed by
Junio C Hamano

parent
5a26973025
commit
d492b31caf
@ -41,7 +41,7 @@ git commit -q -a -m second
|
||||
|
||||
test_expect_success 'nothing recorded without rerere' '
|
||||
(rm -rf .git/rr-cache; git config rerere.enabled false) &&
|
||||
! git merge first &&
|
||||
test_must_fail git merge first &&
|
||||
! test -d .git/rr-cache
|
||||
'
|
||||
|
||||
@ -50,7 +50,7 @@ test_expect_success 'conflicting merge' '
|
||||
git reset --hard &&
|
||||
mkdir .git/rr-cache &&
|
||||
git config --unset rerere.enabled &&
|
||||
! git merge first
|
||||
test_must_fail git merge first
|
||||
'
|
||||
|
||||
sha1=$(sed -e 's/ .*//' .git/rr-cache/MERGE_RR)
|
||||
@ -61,7 +61,7 @@ test_expect_success 'rerere.enabled works, too' '
|
||||
rm -rf .git/rr-cache &&
|
||||
git config rerere.enabled true &&
|
||||
git reset --hard &&
|
||||
! git merge first &&
|
||||
test_must_fail git merge first &&
|
||||
grep ======= $rr/preimage
|
||||
'
|
||||
|
||||
@ -120,7 +120,7 @@ test_expect_success 'another conflicting merge' '
|
||||
git checkout -b third master &&
|
||||
git show second^:a1 | sed "s/To die: t/To die! T/" > a1 &&
|
||||
git commit -q -a -m third &&
|
||||
! git pull . first
|
||||
test_must_fail git pull . first
|
||||
'
|
||||
|
||||
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' '
|
||||
echo Bello > file2 &&
|
||||
git add file2 &&
|
||||
git commit -m version2 &&
|
||||
! git merge fourth &&
|
||||
test_must_fail git merge fourth &&
|
||||
sha1=$(sed -e "s/ .*//" .git/rr-cache/MERGE_RR) &&
|
||||
rr=.git/rr-cache/$sha1 &&
|
||||
echo Cello > file2 &&
|
||||
|
Reference in New Issue
Block a user