Merge branch 'cc/bisect' (early part)
[gitweb.git] / t / t7002-grep.sh
index 5e359cb561b6d6f7c1bae678b7b823ed2ce34cf1..b81593780a2a6adaf34bb10293b607e3a303cfcd 100755 (executable)
@@ -26,6 +26,10 @@ test_expect_success setup '
        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
@@ -109,7 +113,7 @@ do
        '
 
        test_expect_success "grep -c $L (no /dev/null)" '
-               ! git grep -c test $H | grep -q /dev/null
+               ! git grep -c test $H | grep /dev/null
         '
 
 done
@@ -161,7 +165,14 @@ test_expect_success 'log grep (6)' '
        git log --author=-0700  --pretty=tformat:%s >actual &&
        >expect &&
        test_cmp expect actual
+'
 
+test_expect_success 'grep with CE_VALID file' '
+       git update-index --assume-unchanged t/t &&
+       rm t/t &&
+       test "$(git grep --no-ext-grep t)" = "t/t:test" &&
+       git update-index --no-assume-unchanged t/t &&
+       git checkout t/t
 '
 
 test_done