]> git.ipfire.org Git - thirdparty/git.git/commit - t/t7810-grep.sh
Fix "grep -w"
authorJunio C Hamano <junkio@cox.net>
Sat, 5 Aug 2006 05:16:42 +0000 (22:16 -0700)
committerJunio C Hamano <junkio@cox.net>
Sun, 6 Aug 2006 08:37:08 +0000 (01:37 -0700)
commitf25b79397c9775df9eeef3d59d0cc3b1f913bc60
treed3506d5985b0d529ac87e6b1d3cb69cb3451c7fd
parent0d958ac47a333b68b79cdc3ea206bb9a9b7486ad
Fix "grep -w"

We used to find the first match of the pattern and then if the
match is not for the entire word, declared that the whole line
does not match.

But that is wrong.  The command "git grep -w -e mmap" should
find that a line "foo_mmap bar mmap baz" matches, by tring the
second instance of pattern "mmap" on the same line.

Problems an earlier round of "fix" had were pointed out by Morten
Welinder, which have been incorporated in the t7002 tests.

Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-grep.c
t/t7002-grep.sh [new file with mode: 0755]