Merge branch 'pb/test-must-fail-is-for-git'
authorJunio C Hamano <gitster@pobox.com>
Wed, 18 Jan 2017 23:12:15 +0000 (15:12 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 18 Jan 2017 23:12:15 +0000 (15:12 -0800)
Test cleanup.

* pb/test-must-fail-is-for-git:
t9813: avoid using pipes
don't use test_must_fail with grep

1  2 
t/t3510-cherry-pick-sequence.sh
t/t7610-mergetool.sh
index 372307c21b983437b870ac65ff4f91d2c36fab30,362448742e767a7af8c322187c2249b4990d73c4..0acf4b14614c750d3c2324d8a941aa77d5c7ad56
@@@ -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 63d36fb28e44426708a743979c4bc341bdac714e,caf907b297d36e3aa7f3121264e4af44610a8a46..0fe7e58cfbcfcf42b53389df772815378bccc8f2
@@@ -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' '
        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
  '