summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6c2a602)
raw | patch | inline | side by side (parent: 6c2a602)
author | Brandon Casey <drafnel@gmail.com> | |
Thu, 16 Oct 2008 00:58:49 +0000 (19:58 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 16 Oct 2008 15:31:56 +0000 (08:31 -0700) |
This test used the non-zero exit status of 'git diff' to indicate that a
negated funcname pattern, when placed last, was correctly rejected.
The problem with this is that 'git diff' always returns non-zero if it
finds differences in the files it is comparing, and the files must
contain differences in order to trigger the funcname pattern codepath.
Instead of checking for non-zero exit status, make sure the expected
error message is printed.
Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
negated funcname pattern, when placed last, was correctly rejected.
The problem with this is that 'git diff' always returns non-zero if it
finds differences in the files it is comparing, and the files must
contain differences in order to trigger the funcname pattern codepath.
Instead of checking for non-zero exit status, make sure the expected
error message is printed.
Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4018-diff-funcname.sh | patch | blob | history |
index 99fff973eb2479d7ec599b8fd298d4a970176244..72076eca80e4fcf018841ffce4346f17bbb47055 100755 (executable)
--- a/t/t4018-diff-funcname.sh
+++ b/t/t4018-diff-funcname.sh
test_expect_success 'last regexp must not be negated' '
git config diff.java.funcname "!static" &&
- test_must_fail git diff --no-index Beer.java Beer-correct.java
+ git diff --no-index Beer.java Beer-correct.java 2>&1 |
+ grep "fatal: Last expression must not be negated:"
'
test_expect_success 'alternation in pattern' '