diff --git a/t/t7002-grep.sh b/t/t7002-grep.sh
index c4938544d4ca7c5e7e886a59144c9b10b7971748..f275af82403dc0f1de4c584074c0eb63e61a6704 100755 (executable)
--- a/t/t7002-grep.sh
+++ b/t/t7002-grep.sh
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
'
+test_expect_success 'grep should not segfault with a bad input' '
+ test_must_fail git grep "("
+'
+
for H in HEAD ''
do
case "$H" in
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