diff options
authorBrandon Casey <>2008-10-16 00:58:49 (GMT)
committerJunio C Hamano <>2008-10-16 15:31:56 (GMT)
commit16b26725368f7b80711d9a631029fbb869646f9c (patch)
parent6c2a6022dbc5879f5d6c267925408e484be6214a (diff)
t4018-diff-funcname: rework negated last expression test
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 <> Signed-off-by: Junio C Hamano <>
1 files changed, 2 insertions, 1 deletions
diff --git a/t/ b/t/
index 99fff97..72076ec 100755
--- a/t/
+++ b/t/
@@ -65,7 +65,8 @@ test_expect_success 'custom pattern' '
test_expect_success 'last regexp must not be negated' '
git config "!static" &&
- test_must_fail git diff --no-index
+ git diff --no-index 2>&1 |
+ grep "fatal: Last expression must not be negated:"
test_expect_success 'alternation in pattern' '