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
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-07-14 02:52:53 +0300
committerJunio C Hamano <gitster@pobox.com>2021-07-14 02:52:53 +0300
commit1157618a2ae50ae611ca22ce1833760bc0456156 (patch)
tree7e0a1cbd4401c16d93a82981a385726655cc052c /t/t7810-grep.sh
parent21ef7ee4d6104c35fc6753da5406c842fb2d9286 (diff)
parentfe7fe62d8da0949d9b2bca34467b349bd294e91b (diff)
Merge branch 'rs/grep-parser-fix'
"git grep --and -e foo" ought to have been diagnosed as an error but instead segfaulted, which has been corrected. * rs/grep-parser-fix: grep: report missing left operand of --and
Diffstat (limited to 't/t7810-grep.sh')
-rwxr-xr-xt/t7810-grep.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh
index 5830733f3d..6b6423a07c 100755
--- a/t/t7810-grep.sh
+++ b/t/t7810-grep.sh
@@ -11,6 +11,13 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
+test_invalid_grep_expression() {
+ params="$@" &&
+ test_expect_success "invalid expression: grep $params" '
+ test_must_fail git grep $params -- nonexisting
+ '
+}
+
cat >hello.c <<EOF
#include <assert.h>
#include <stdio.h>
@@ -89,6 +96,8 @@ test_expect_success 'grep should not segfault with a bad input' '
test_must_fail git grep "("
'
+test_invalid_grep_expression --and -e A
+
for H in HEAD ''
do
case "$H" in