if (!opt.pattern_list)
die(_("no pattern given."));
+ if (opt.regflags != REG_NEWLINE && opt.pcre)
+ die(_("cannot mix --extended-regexp and --perl-regexp"));
if (!opt.fixed && opt.ignore_case)
opt.regflags |= REG_ICASE;
- if ((opt.regflags != REG_NEWLINE) && opt.fixed)
+ if ((opt.regflags != REG_NEWLINE || opt.pcre) && opt.fixed)
die(_("cannot mix --fixed-strings and regexp"));
#ifndef NO_PTHREADS
test_cmp expected actual
'
+test_expect_success LIBPCRE 'grep -P -F returns error' '
+ test_expect_code 128 git grep -P -F main
+'
+
+test_expect_success LIBPCRE 'grep -P -E returns error' '
+ test_expect_code 128 git grep -P -E main
+'
+
+test_expect_failure LIBPCRE 'grep -P -G returns error' '
+ test_expect_code 128 git grep -P -G main
+'
+
+test_expect_failure LIBPCRE 'grep -P -E -G returns error' '
+ test_expect_code 128 git grep -P -E -G main
+'
+
test_done