Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-12-19 02:15:18 +0300
committerJunio C Hamano <gitster@pobox.com>2020-12-19 02:15:18 +0300
commit59fcf746f5a6253b3c0a84a94ecd5cf1add56e3a (patch)
treef2eca2aa27d7014846d4d0381ad1306c48c5b964 /t/t4015-diff-whitespace.sh
parentd4187bd4d5091cf2700b0a954cbdc379e5d1248d (diff)
parent50f04394908fe308a421b360951b1f73b00363ee (diff)
Merge branch 'jc/diff-I-status-fix'
"git diff -I<pattern> -exit-code" should exit with 0 status when all the changes match the ignored pattern, but it didn't. * jc/diff-I-status-fix: diff: correct interaction between --exit-code and -I<pattern>
Diffstat (limited to 't/t4015-diff-whitespace.sh')
-rwxr-xr-xt/t4015-diff-whitespace.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
index 47f0e2889d..8c574221b2 100755
--- a/t/t4015-diff-whitespace.sh
+++ b/t/t4015-diff-whitespace.sh
@@ -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 &&