summaryrefslogtreecommitdiff
path: root/t/t4018-diff-funcname.sh
diff options
context:
space:
mode:
authorBrandon Casey <casey@nrlssc.navy.mil>2008-10-01 19:28:26 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-10-16 15:31:56 (GMT)
commit563d5a2c84fb5daf77dd8bfe569e92566a8fd52b (patch)
tree36c847c21a3e882bd2db3ef33c83722bf11c8518 /t/t4018-diff-funcname.sh
parentb19d288b4d440c76348b519d06a4ed7b62c93611 (diff)
downloadgit-563d5a2c84fb5daf77dd8bfe569e92566a8fd52b.zip
git-563d5a2c84fb5daf77dd8bfe569e92566a8fd52b.tar.gz
git-563d5a2c84fb5daf77dd8bfe569e92566a8fd52b.tar.bz2
xdiff-interface.c: strip newline (and cr) from line before pattern matching
POSIX doth sayeth: "In the regular expression processing described in IEEE Std 1003.1-2001, the <newline> is regarded as an ordinary character and both a period and a non-matching list can match one. ... Those utilities (like grep) that do not allow <newline>s to match are responsible for eliminating any <newline> from strings before matching against the RE." Thus far git has not been removing the trailing newline from strings matched against regular expression patterns. This has the effect that (quoting Jonathan del Strother) "... a line containing just 'FUNCNAME' (terminated by a newline) will be matched by the pattern '^(FUNCNAME.$)' but not '^(FUNCNAME$)'", and more simply not '^FUNCNAME$'. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 't/t4018-diff-funcname.sh')
-rwxr-xr-xt/t4018-diff-funcname.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t4018-diff-funcname.sh b/t/t4018-diff-funcname.sh
index 40a805a..398bf4b 100755
--- a/t/t4018-diff-funcname.sh
+++ b/t/t4018-diff-funcname.sh
@@ -69,7 +69,7 @@ test_expect_success 'last regexp must not be negated' '
grep "fatal: Last expression must not be negated:"
'
-test_expect_failure 'pattern which matches to end of line' '
+test_expect_success 'pattern which matches to end of line' '
git config diff.java.funcname "Beer$" &&
git diff --no-index Beer.java Beer-correct.java |
grep "^@@.*@@ Beer"