X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft4017-diff-retval.sh;h=60dd2014d5ae5d5e9e168b8b60278d90ef93cc53;hb=fbdc05661d9b732d06c47ccb3d5836d0d1b563e5;hp=dc0b7126cc996594b415058d83014a2c7d732895;hpb=c7ea453618e41e05a06f05e3ab63d555d0ddd7d9;p=git.git diff --git a/t/t4017-diff-retval.sh b/t/t4017-diff-retval.sh index dc0b7126c..60dd2014d 100755 --- a/t/t4017-diff-retval.sh +++ b/t/t4017-diff-retval.sh @@ -105,4 +105,26 @@ test_expect_success '--check with --no-pager returns 2 for dirty difference' ' ' + +test_expect_success 'check should test not just the last line' ' + echo "" >>a && + git --no-pager diff --check + test $? = 2 + +' + +test_expect_success 'check detects leftover conflict markers' ' + git reset --hard && + git checkout HEAD^ && + echo binary >>b && + git commit -m "side" b && + test_must_fail git merge master && + git add b && ( + git --no-pager diff --cached --check >test.out + test $? = 2 + ) && + test 3 = $(grep "conflict marker" test.out | wc -l) && + git reset --hard +' + test_done