]> git.ipfire.org Git - thirdparty/git.git/commit - diff.c
diff: correct interaction between --exit-code and -I<pattern>
authorJunio C Hamano <gitster@pobox.com>
Thu, 17 Dec 2020 01:27:13 +0000 (17:27 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 17 Dec 2020 01:33:26 +0000 (17:33 -0800)
commit50f04394908fe308a421b360951b1f73b00363ee
treed337ef464efc41b9a293bbf5b6e617f81dc9b14e
parent296d4a94e7231a1d57356889f51bff57a1a3c5a1
diff: correct interaction between --exit-code and -I<pattern>

Just like "git diff -w --exit-code" should exit with 0 when ignoring
whitespace differences results in no changes shown, if ignoring
certain changes with "git diff -I<pattern> --exit-code" result in an
empty patch, we should exit with 0.

The test suite did not cover the interaction between "--exit-code"
and "-w"; add one while adding a new test for "--exit-code" + "-I".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c
t/t4015-diff-whitespace.sh