summaryrefslogtreecommitdiff
path: root/t/t4202-log.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2022-02-25 15:47:35 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2022-02-25 15:47:36 -0800
commit5b84280c65bef19bc3a810e17474c9861ea7ce89 (patch)
treec534ac39e58573c776dcd9702636496a5cd000ad /t/t4202-log.sh
parentMerge branch 'js/apply-partial-clone-filters-recursively' (diff)
parentgrep: simplify config parsing and option parsing (diff)
downloadtgif-5b84280c65bef19bc3a810e17474c9861ea7ce89.tar.xz
Merge branch 'ab/grep-patterntype'
Some code clean-up in the "git grep" machinery. * ab/grep-patterntype: grep: simplify config parsing and option parsing grep.c: do "if (bool && memchr())" not "if (memchr() && bool)" grep.h: make "grep_opt.pattern_type_option" use its enum grep API: call grep_config() after grep_init() grep.c: don't pass along NULL callback value built-ins: trust the "prefix" from run_builtin() grep tests: add missing "grep.patternType" config tests grep tests: create a helper function for "BRE" or "ERE" log tests: check if grep_config() is called by "log"-like cmds grep.h: remove unused "regex_t regexp" from grep_opt
Diffstat (limited to 't/t4202-log.sh')
-rwxr-xr-xt/t4202-log.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 544f0aa82e..55fac64446 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -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>