summaryrefslogtreecommitdiff
path: root/t/t3301-notes.sh
diff options
context:
space:
mode:
authorJohan Herland <johan@herland.net>2010-02-13 22:28:21 +0100
committerJunio C Hamano <gitster@pobox.com>2010-02-13 19:36:13 -0800
commitb24bb99756c8b6fde01c23ebbb4abc37d12fb1eb (patch)
tree11e5c83dc685565ab09d01e29622245f54414eda /t/t3301-notes.sh
parentcd067d3bf4ea3f89969cd143be3e281e1c5ac58a (diff)
downloadgit-b24bb99756c8b6fde01c23ebbb4abc37d12fb1eb.tar.gz
t3301: Verify successful annotation of non-commits
Adds a testcase verifying that git-notes works successfully on tree, blob, and tag objects. 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.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh
index 10f62f4122..fd5e593ae6 100755
--- a/t/t3301-notes.sh
+++ b/t/t3301-notes.sh
@@ -282,4 +282,21 @@ test_expect_success 'Do not show note when core.notesRef is overridden' '
test_cmp expect-not-other output
'
+test_expect_success 'Allow notes on non-commits (trees, blobs, tags)' '
+ echo "Note on a tree" > expect
+ git notes edit -m "Note on a tree" HEAD: &&
+ git notes show HEAD: > actual &&
+ test_cmp expect actual &&
+ echo "Note on a blob" > expect
+ filename=$(git ls-tree --name-only HEAD | head -n1) &&
+ git notes edit -m "Note on a blob" HEAD:$filename &&
+ git notes show HEAD:$filename > actual &&
+ test_cmp expect actual &&
+ echo "Note on a tag" > expect
+ git tag -a -m "This is an annotated tag" foobar HEAD^ &&
+ git notes edit -m "Note on a tag" foobar &&
+ git notes show foobar > actual &&
+ test_cmp expect actual
+'
+
test_done