aboutsummaryrefslogtreecommitdiff
path: root/t/t3301-notes.sh
diff options
context:
space:
mode:
authorJohan Herland <johan@herland.net>2010-02-13 22:28:25 +0100
committerJunio C Hamano <gitster@pobox.com>2010-02-13 19:36:14 -0800
commit92b3385fca620f47580d695b80b96432c76f0822 (patch)
treea82178402ddd241eaf1d37ab255a0d778535ceec /t/t3301-notes.sh
parenta0b4dfa9b35a2ebac578ea5547b041bb78557238 (diff)
downloadgit-92b3385fca620f47580d695b80b96432c76f0822.tar.gz
git-92b3385fca620f47580d695b80b96432c76f0822.tar.xz
builtin-notes: Add "remove" subcommand for removing existing notes
Using "git notes remove" is equivalent to specifying an empty note message. The patch includes tests verifying correct behaviour of the new subcommand. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3301-notes.sh')
-rwxr-xr-xt/t3301-notes.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh
index fe59e73c2..d29daac5b 100755
--- a/t/t3301-notes.sh
+++ b/t/t3301-notes.sh
@@ -265,6 +265,33 @@ test_expect_success 'verify non-creation of note with -m ""' '
! git notes show
'
+test_expect_success 'remove note with "git notes remove" (setup)' '
+ git notes remove HEAD^
+'
+
+cat > expect-rm-remove << EOF
+commit bd1753200303d0a0344be813e504253b3d98e74d
+Author: A U Thor <author@example.com>
+Date: Thu Apr 7 15:17:13 2005 -0700
+
+ 5th
+
+commit 15023535574ded8b1a89052b32673f84cf9582b8
+Author: A U Thor <author@example.com>
+Date: Thu Apr 7 15:16:13 2005 -0700
+
+ 4th
+EOF
+
+printf "\n" >> expect-rm-remove
+cat expect-multiline >> expect-rm-remove
+
+test_expect_success 'verify note removal with "git notes remove"' '
+ git log -4 > output &&
+ test_cmp expect-rm-remove output &&
+ ! git notes show HEAD^
+'
+
test_expect_success 'create other note on a different notes ref (setup)' '
: > a6 &&
git add a6 &&