@@ -451,6 +451,65 @@ do
test_cmp expected actual
'
+ test_expect_success "grep $L with grep.extendedRegexp is last-one-wins" '
+ echo "${HC}ab:a+bc" >expected &&
+ git \
+ -c grep.extendedRegexp=true \
+ -c grep.patternType=basic \
+ -c grep.extendedRegexp=false \
+ grep "a+b*c" $H ab >actual &&
+ test_cmp expected actual
+ '
+
+ test_expect_success "grep $L with grep.extendedRegexp is last-one-wins & defers to grep.patternType" '
+ echo "${HC}ab:abc" >expected &&
+ git \
+ -c grep.extendedRegexp=true \
+ -c grep.patternType=extended \
+ -c grep.extendedRegexp=false \
+ grep "a+b*c" $H ab >actual &&
+ test_cmp expected actual
+ '
+
+ test_expect_success "grep $L with grep.extendedRegexp and grep.patternType are both last-one-wins independently (BRE)" '
+ echo "${HC}ab:abc" >expected &&
+ git \
+ -c grep.patternType=fixed \
+ -c grep.extendedRegexp=true \
+ -c grep.patternType=default \
+ grep "a+b*c" $H ab >actual &&
+ test_cmp expected actual
+ '
+
+ test_expect_success "grep $L with grep.extendedRegexp and grep.patternType are both last-one-wins independently (ERE)" '
+ echo "${HC}ab:a+bc" >expected &&
+ git \
+ -c grep.patternType=default \
+ -c grep.extendedRegexp=true \
+ -c grep.patternType=basic \
+ grep "a+b*c" $H ab >actual &&
+ test_cmp expected actual
+ '
+
+ test_expect_success "grep $L with grep.patternType=extended and grep.patternType=default" '
+ echo "${HC}ab:a+bc" >expected &&
+ git \
+ -c grep.patternType=extended \
+ -c grep.patternType=default \
+ grep "a+b*c" $H ab >actual &&
+ test_cmp expected actual
+ '
+
+ test_expect_success "grep $L with grep.patternType=[extended -> default -> fixed]" '
+ echo "${HC}ab:a+b*c" >expected &&
+ git \
+ -c grep.patternType=extended \
+ -c grep.patternType=default \
+ -c grep.patternType=fixed \
+ grep "a+b*c" $H ab >actual &&
+ test_cmp expected actual
+ '
+
test_expect_success "grep $L with grep.patternType=extended and grep.extendedRegexp=false" '
echo "${HC}ab:abc" >expected &&
git \
@@ -478,6 +537,15 @@ do
test_cmp expected actual
'
+ test_expect_success "grep $L with grep.extendedRegexp=false and grep.patternType=default" '
+ echo "${HC}ab:abc" >expected &&
+ git \
+ -c grep.extendedRegexp=false \
+ -c grep.patternType=extended \
+ grep "a+b*c" $H ab >actual &&
+ test_cmp expected actual
+ '
+
test_expect_success "grep $L with grep.extendedRegexp=true and grep.patternType=basic" '
echo "${HC}ab:a+bc" >expected &&
git \