]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t4202-log.sh
Merge branch 'ab/grep-patterntype'
[thirdparty/git.git] / t / t4202-log.sh
index 544f0aa82ed70444337b701323ab6822cdf814d6..55fac644464f39b0534d8c0a64aaabb9741f696d 100755 (executable)
@@ -462,6 +462,30 @@ test_expect_success !FAIL_PREREQS 'log with various grep.patternType configurati
        )
 '
 
+for cmd in show whatchanged reflog format-patch
+do
+       case "$cmd" in
+       format-patch) myarg="HEAD~.." ;;
+       *) myarg= ;;
+       esac
+
+       test_expect_success "$cmd: understands grep.patternType, like 'log'" '
+               git init "pattern-type-$cmd" &&
+               (
+                       cd "pattern-type-$cmd" &&
+                       test_commit 1 file A &&
+                       test_commit "(1|2)" file B 2 &&
+
+                       git -c grep.patternType=fixed $cmd --grep="..." $myarg >actual &&
+                       test_must_be_empty actual &&
+
+                       git -c grep.patternType=basic $cmd --grep="..." $myarg >actual &&
+                       test_file_not_empty actual
+               )
+       '
+done
+test_done
+
 test_expect_success 'log --author' '
        cat >expect <<-\EOF &&
        Author: <BOLD;RED>A U<RESET> Thor <author@example.com>