summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2011-03-29 16:59:42 -0400
committerJunio C Hamano <gitster@pobox.com>2011-03-29 14:39:24 -0700
commit92e0d42539a34e90f5c9bf29eb741f0d87173027 (patch)
tree8eead1847476de332ab32cf9d8dcba88a89d21f3 /t
parent7249e91287443c02b2c7eed272a579dae44984ad (diff)
downloadgit-92e0d42539a34e90f5c9bf29eb741f0d87173027.tar.gz
revision.c: make --no-notes reset --notes list
With most command line options, later instances of an option override earlier ones. With cumulative options like "--notes", however, there is no way to say "forget the --notes I gave you before". Let's have --no-notes trigger this forgetting, so that: git log --notes=foo --no-notes --notes=bar will show only the "bar" notes. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t3301-notes.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh
index f0e7a58123..8600db7edb 100755
--- a/t/t3301-notes.sh
+++ b/t/t3301-notes.sh
@@ -269,6 +269,22 @@ test_expect_success 'git log --notes --notes=X shows both' '
grep alternate output
'
+test_expect_success 'git log --no-notes resets default state' '
+ git log -1 --notes --notes=alternate \
+ --no-notes --notes=alternate \
+ >output &&
+ ! grep xyzzy output &&
+ grep alternate output
+'
+
+test_expect_success 'git log --no-notes resets ref list' '
+ git log -1 --notes --notes=alternate \
+ --no-notes --notes \
+ >output &&
+ grep xyzzy output &&
+ ! grep alternate output
+'
+
test_expect_success 'create -m notes (setup)' '
: > a5 &&
git add a5 &&