summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2022-01-05 14:01:30 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2022-01-05 14:01:30 -0800
commit2043ce828e8020778c5460eaf7d5a207317c1c09 (patch)
tree51a85e0b9679bceb8fa2dfbae89d163e4884e28b /t
parentMerge branch 'gh/gpg-doc-markup-fix' (diff)
parentlog: let --invert-grep only invert --grep (diff)
downloadtgif-2043ce828e8020778c5460eaf7d5a207317c1c09.tar.xz
Merge branch 'rs/log-invert-grep-with-headers'
"git log --invert-grep --author=<name>" used to exclude commits written by the given author, but now "--invert-grep" only affects the matches made by the "--grep=<pattern>" option. * rs/log-invert-grep-with-headers: log: let --invert-grep only invert --grep
Diffstat (limited to 't')
-rwxr-xr-xt/t4202-log.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 6187b91f9f..5049559861 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -2090,4 +2090,23 @@ test_expect_success 'log --end-of-options' '
test_cmp expect actual
'
+test_expect_success 'set up commits with different authors' '
+ git checkout --orphan authors &&
+ test_commit --author "Jim <jim@example.com>" jim_1 &&
+ test_commit --author "Val <val@example.com>" val_1 &&
+ test_commit --author "Val <val@example.com>" val_2 &&
+ test_commit --author "Jim <jim@example.com>" jim_2 &&
+ test_commit --author "Val <val@example.com>" val_3 &&
+ test_commit --author "Jim <jim@example.com>" jim_3
+'
+
+test_expect_success 'log --invert-grep --grep --author' '
+ cat >expect <<-\EOF &&
+ val_3
+ val_1
+ EOF
+ git log --format=%s --author=Val --grep 2 --invert-grep >actual &&
+ test_cmp expect actual
+'
+
test_done