Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-02-26 02:47:35 +0300
committerJunio C Hamano <gitster@pobox.com>2022-02-26 02:47:36 +0300
commit5b84280c65bef19bc3a810e17474c9861ea7ce89 (patch)
treec534ac39e58573c776dcd9702636496a5cd000ad /t/t4202-log.sh
parent2e65591ed61ab488395c454004106a5e9424648e (diff)
parent04bf052eef53c6be04d313d8ce11690beaf890b6 (diff)
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>