From: Junio C Hamano Date: Tue, 13 Jul 2021 23:52:53 +0000 (-0700) Subject: Merge branch 'rs/grep-parser-fix' X-Git-Tag: v2.33.0-rc0~59 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1157618a2ae50ae611ca22ce1833760bc0456156;p=thirdparty%2Fgit.git 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 --- 1157618a2ae50ae611ca22ce1833760bc0456156 diff --cc t/t7810-grep.sh index 5830733f3d,47434e6687..6b6423a07c --- a/t/t7810-grep.sh +++ b/t/t7810-grep.sh @@@ -6,11 -6,15 +6,18 @@@ test_description='git grep various. ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main +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 < #include