summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Ævar Arnfjörð Bjarmason <avarab@gmail.com>2021-04-12 19:15:11 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-05-11 12:47:31 +0900
commit69ae93089cd892d70429f7f06371860d65cb1f1b (patch)
tree71d2180307c7d93e258709af42cdd2ac6f6cd8fb /t
parentpickaxe tests: add test for diffgrep_consume() internals (diff)
downloadtgif-69ae93089cd892d70429f7f06371860d65cb1f1b.tar.xz
pickaxe tests: add test for "log -S" not being a regex
No test in our test suite checked for "log -S<pat>" being a fixed string, as opposed to "log -S<pat> --pickaxe-regex". Let's test for it. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t4209-log-pickaxe.sh30
1 files changed, 27 insertions, 3 deletions
diff --git a/t/t4209-log-pickaxe.sh b/t/t4209-log-pickaxe.sh
index eacb9f0a1b..9fa770b5fb 100755
--- a/t/t4209-log-pickaxe.sh
+++ b/t/t4209-log-pickaxe.sh
@@ -106,11 +106,18 @@ test_expect_success 'log -S --no-textconv (missing textconv tool)' '
rm .gitattributes
'
-test_expect_success 'setup log -[GS] plain' '
+test_expect_success 'setup log -[GS] plain & regex' '
test_create_repo GS-plain &&
test_commit -C GS-plain --append A data.txt "a" &&
test_commit -C GS-plain --append B data.txt "a a" &&
- test_commit -C GS-plain C data.txt "" &&
+ test_commit -C GS-plain --append C data.txt "b" &&
+ test_commit -C GS-plain --append D data.txt "[b]" &&
+ test_commit -C GS-plain E data.txt "" &&
+
+ # We also include E, the deletion commit
+ git -C GS-plain log --grep="[ABE]" >A-to-B-then-E-log &&
+ git -C GS-plain log --grep="[CDE]" >C-to-D-then-E-log &&
+ git -C GS-plain log --grep="[DE]" >D-then-E-log &&
git -C GS-plain log >full-log
'
@@ -118,7 +125,24 @@ test_expect_success 'log -G trims diff new/old [-+]' '
git -C GS-plain log -G"[+-]a" >log &&
test_must_be_empty log &&
git -C GS-plain log -G"^a" >log &&
- test_cmp log full-log
+ test_cmp log A-to-B-then-E-log
+'
+
+test_expect_success 'log -S<pat> is not a regex, but -S<pat> --pickaxe-regex is' '
+ git -C GS-plain log -S"a" >log &&
+ test_cmp log A-to-B-then-E-log &&
+
+ git -C GS-plain log -S"[a]" >log &&
+ test_must_be_empty log &&
+
+ git -C GS-plain log -S"[a]" --pickaxe-regex >log &&
+ test_cmp log A-to-B-then-E-log &&
+
+ git -C GS-plain log -S"[b]" >log &&
+ test_cmp log D-then-E-log &&
+
+ git -C GS-plain log -S"[b]" --pickaxe-regex >log &&
+ test_cmp log C-to-D-then-E-log
'
test_expect_success 'setup log -[GS] binary & --text' '