From: Junio C Hamano Date: Wed, 18 Jan 2017 23:12:15 +0000 (-0800) Subject: Merge branch 'pb/test-must-fail-is-for-git' X-Git-Tag: v2.12.0-rc0~65 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/c7f352f31ad0593f7772a155980b16cbbaac3dec?hp=-c Merge branch 'pb/test-must-fail-is-for-git' Test cleanup. * pb/test-must-fail-is-for-git: t9813: avoid using pipes don't use test_must_fail with grep --- c7f352f31ad0593f7772a155980b16cbbaac3dec diff --combined t/t3510-cherry-pick-sequence.sh index 372307c21b,362448742e..0acf4b1461 --- a/t/t3510-cherry-pick-sequence.sh +++ b/t/t3510-cherry-pick-sequence.sh @@@ -147,16 -147,6 +147,16 @@@ test_expect_success '--abort to cancel git diff-index --exit-code HEAD ' +test_expect_success '--abort does not unsafely change HEAD' ' + pristine_detach initial && + test_must_fail git cherry-pick picked anotherpick && + git reset --hard base && + test_must_fail git cherry-pick picked anotherpick && + git cherry-pick --abort 2>actual && + test_i18ngrep "You seem to have moved HEAD" actual && + test_cmp_rev base HEAD +' + test_expect_success 'cherry-pick --abort to cancel multiple revert' ' pristine_detach anotherpick && test_expect_code 1 git revert base..picked && @@@ -385,7 -375,7 +385,7 @@@ test_expect_success '--continue respect git cat-file commit HEAD~1 >picked_msg && git cat-file commit HEAD~2 >unrelatedpick_msg && git cat-file commit HEAD~3 >initial_msg && - test_must_fail grep "cherry picked from" initial_msg && + ! grep "cherry picked from" initial_msg && grep "cherry picked from" unrelatedpick_msg && grep "cherry picked from" picked_msg && grep "cherry picked from" anotherpick_msg @@@ -426,9 -416,9 +426,9 @@@ test_expect_failure '--signoff is autom git cat-file commit HEAD~1 >picked_msg && git cat-file commit HEAD~2 >unrelatedpick_msg && git cat-file commit HEAD~3 >initial_msg && - test_must_fail grep "Signed-off-by:" initial_msg && + ! grep "Signed-off-by:" initial_msg && grep "Signed-off-by:" unrelatedpick_msg && - test_must_fail grep "Signed-off-by:" picked_msg && + ! grep "Signed-off-by:" picked_msg && grep "Signed-off-by:" anotherpick_msg ' diff --combined t/t7610-mergetool.sh index 63d36fb28e,caf907b297..0fe7e58cfb --- a/t/t7610-mergetool.sh +++ b/t/t7610-mergetool.sh @@@ -591,8 -591,7 +591,8 @@@ test_expect_success 'filenames seen by test_lazy_prereq MKTEMP ' tempdir=$(mktemp -d -t foo.XXXXXX) && - test -d "$tempdir" + test -d "$tempdir" && + rmdir "$tempdir" ' test_expect_success MKTEMP 'temporary filenames are used with mergetool.writeToTemp' ' @@@ -602,7 -601,7 +602,7 @@@ test_config mergetool.myecho.trustExitCode true && test_must_fail git merge master && git mergetool --no-prompt --tool myecho -- both >actual && - test_must_fail grep ^\./both_LOCAL_ actual >/dev/null && + ! grep ^\./both_LOCAL_ actual >/dev/null && grep /both_LOCAL_ actual >/dev/null && git reset --hard master >/dev/null 2>&1 '