Skip to content

Commit 7cd5d5b

Browse files
avargitster
authored andcommitted
pickaxe tests: add missing test for --no-pickaxe-regex being an error
Add a missing test for --no-pickaxe-regex. This has been an error ever since before the -S or -G options were added, or since 7ae0b0c (git-log (internal): more options., 2006-03-01). The reason for adding this test is that Junio suggested in [1] in response to a later test addition in this series that it might be good to support --no-pickaxe-regex in combination with -G. This would allow for fixed-string searching with -G, similr to grep's --fixed-strings mode. I agree that that would make sense if anyone would like to implement it, but since it dies right now let's first add this test to assert the existing long-standing behavior. We can always add support for --[no-]pickaxe-regex in combination with -G at some later date. 1. http://lore.kernel.org/git/[email protected] Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 064952f commit 7cd5d5b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

t/t4209-log-pickaxe.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,18 @@ test_expect_success 'usage' '
6666
grep "mutually exclusive" err
6767
'
6868

69+
test_expect_success 'usage: --no-pickaxe-regex' '
70+
cat >expect <<-\EOF &&
71+
fatal: unrecognized argument: --no-pickaxe-regex
72+
EOF
73+
74+
test_expect_code 128 git log -Sstring --no-pickaxe-regex 2>actual &&
75+
test_cmp expect actual &&
76+
77+
test_expect_code 128 git log -Gstring --no-pickaxe-regex 2>err &&
78+
test_cmp expect actual
79+
'
80+
6981
test_log expect_initial --grep initial
7082
test_log expect_nomatch --grep InItial
7183
test_log_icase expect_initial --grep InItial

0 commit comments

Comments
 (0)