@matheusbsbs / matheus-bagliano / commits / b24bb99756
Fork 0

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>

Johan Herland committed Feb 13, 2010 at 22:28 UTC b24bb99756c8b6fde01c23ebbb4abc37d12fb1eb
1 file changed +17
t/t3301-notes.sh
+17
@@ -282,4 +282,21 @@ test_expect_success 'Do not show note when core.notesRef is overridden' '
282 test_cmp expect-not-other output
283 '
284
285 +test_expect_success 'Allow notes on non-commits (trees, blobs, tags)' '
286 + echo "Note on a tree" > expect
287 + git notes edit -m "Note on a tree" HEAD: &&
288 + git notes show HEAD: > actual &&
289 + test_cmp expect actual &&
290 + echo "Note on a blob" > expect
291 + filename=$(git ls-tree --name-only HEAD | head -n1) &&
292 + git notes edit -m "Note on a blob" HEAD:$filename &&
293 + git notes show HEAD:$filename > actual &&
294 + test_cmp expect actual &&
295 + echo "Note on a tag" > expect
296 + git tag -a -m "This is an annotated tag" foobar HEAD^ &&
297 + git notes edit -m "Note on a tag" foobar &&
298 + git notes show foobar > actual &&
299 + test_cmp expect actual
300 +'
301 +
302 test_done