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:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-02-16 03:00:31 +0300
committerJunio C Hamano <gitster@pobox.com>2022-02-16 05:00:49 +0300
commitff37a60c36959cc1d774e1a9b266291962e8624d (patch)
tree964049d253371018bb4e69473d48685326f5434b /t/t4202-log.sh
parent77e3f931ef76444d6b28d50ac4fbdc933a15f358 (diff)
log tests: check if grep_config() is called by "log"-like cmds
Extend the tests added in my 9df46763ef1 (log: add exhaustive tests for pattern style options & config, 2017-05-20) to check not only whether "git log" handles "grep.patternType", but also "git show" etc. It's sufficient to check whether we match a "fixed" or a "basic" regex here to see if these codepaths correctly invoked grep_config(). We don't need to check the details of their regular expression matching as the "log" test does. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 5049559861..e775b378e4 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -449,6 +449,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>