]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t4015-diff-whitespace.sh
diff: correct interaction between --exit-code and -I<pattern>
[thirdparty/git.git] / t / t4015-diff-whitespace.sh
index 88d3026894f87f4d86cb6f4178898b6879630e73..8ae02fe3c3155617432f2c56ddefe06d5dd33c1e 100755 (executable)
@@ -567,6 +567,30 @@ test_expect_success '--check and --quiet are not exclusive' '
        git diff --check --quiet
 '
 
+test_expect_success '-w and --exit-code interact sensibly' '
+       test_when_finished "git checkout x" &&
+       {
+               test_seq 15 &&
+               echo " 16"
+       } >x &&
+       test_must_fail git diff --exit-code &&
+       git diff -w >actual &&
+       test_must_be_empty actual &&
+       git diff -w --exit-code
+'
+
+test_expect_success '-I and --exit-code interact sensibly' '
+       test_when_finished "git checkout x" &&
+       {
+               test_seq 15 &&
+               echo " 16"
+       } >x &&
+       test_must_fail git diff --exit-code &&
+       git diff -I. >actual &&
+       test_must_be_empty actual &&
+       git diff -I. --exit-code
+'
+
 test_expect_success 'check staged with no whitespace errors' '
        echo "foo();" >x &&
        git add x &&