log: add -P as a synonym for --perl-regexp
[gitweb.git] / t / t4202-log.sh
index dbed3efeeeeee6ecb4c6cbe7848c18bd684bb2e1..2b07d1c0c224d5ce62ee9fa8960d7ac23c544425 100755 (executable)
@@ -404,8 +404,20 @@ test_expect_success 'log with various grep.patternType configurations & command-
                        --grep="(1|2)" >actual.fixed.short-arg &&
                git log --pretty=tformat:%s -E \
                        --grep="\|2" >actual.extended.short-arg &&
+               if test_have_prereq PCRE
+               then
+                       git log --pretty=tformat:%s -P \
+                               --grep="[\d]\|" >actual.perl.short-arg
+               else
+                       test_must_fail git log -P \
+                               --grep="[\d]\|"
+               fi &&
                test_cmp expect.fixed actual.fixed.short-arg &&
                test_cmp expect.extended actual.extended.short-arg &&
+               if test_have_prereq PCRE
+               then
+                       test_cmp expect.perl actual.perl.short-arg
+               fi &&
 
                git log --pretty=tformat:%s --fixed-strings \
                        --grep="(1|2)" >actual.fixed.long-arg &&