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
path: root/t
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2009-05-23 15:45:26 +0400
committerJunio C Hamano <gitster@pobox.com>2009-05-24 03:29:05 +0400
commitdbb6a4ada6c6c1065b62313127ff032196e9d232 (patch)
tree27c336e0e4c02aa1427379360e2d845ca727c72a /t
parente701fadb9e0e51a6811690d95a53bd1f5b6fad86 (diff)
grep: fix word-regexp at the beginning of lines
After bol is forwarded, it doesn't represent the beginning of the line any more. This means that the beginning-of-line marker (^) mustn't match, i.e. the regex flag REG_NOTBOL needs to be set. This bug was introduced by fb62eb7fab97cea880ea7fe4f341a4dfad14ab48 ("grep -w: forward to next possible position after rejected match"). Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t7002-grep.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/t/t7002-grep.sh b/t/t7002-grep.sh
index b81593780a..f275af8240 100755
--- a/t/t7002-grep.sh
+++ b/t/t7002-grep.sh
@@ -16,12 +16,13 @@ test_expect_success setup '
echo foo mmap bar_mmap
echo foo_mmap bar mmap baz
} >file &&
+ echo ww w >w &&
echo x x xx x >x &&
echo y yy >y &&
echo zzz > z &&
mkdir t &&
echo test >t/t &&
- git add file x y z t/t &&
+ git add file w x y z t/t &&
test_tick &&
git commit -m initial
'
@@ -48,6 +49,12 @@ do
diff expected actual
'
+ test_expect_success "grep -w $L (w)" '
+ : >expected &&
+ ! git grep -n -w -e "^w" >actual &&
+ test_cmp expected actual
+ '
+
test_expect_success "grep -w $L (x)" '
{
echo ${HC}x:1:x x xx x