t3301: add tests to use --format="%N"
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Apr 18, 2010 at 11:19 UTC
636db2c036d0f26bd0b1139b7abe04bdecf3e036
1 file changed
+18
t/t3301-notes.sh
+18
@@ -55,6 +55,15 @@ test_expect_success 'handle empty notes gracefully' '
55
git notes show ; test 1 = $?
56
'
57
58
+test_expect_success 'show non-existent notes entry with %N' '
59
+ for l in A B
60
+ do
61
+ echo "$l"
62
+ done >expect &&
63
+ git show -s --format='A%n%NB' >output &&
64
+ test_cmp expect output
65
+'
66
+
67
test_expect_success 'create notes' '
68
git config core.notesRef refs/notes/commits &&
69
MSG=b4 git notes add &&
@@ -65,6 +74,15 @@ test_expect_success 'create notes' '
74
test_must_fail git notes show HEAD^
75
'
76
77
+test_expect_success 'show notes entry with %N' '
78
+ for l in A b4 B
79
+ do
80
+ echo "$l"
81
+ done >expect &&
82
+ git show -s --format='A%n%NB' >output &&
83
+ test_cmp expect output
84
+'
85
+
86
cat >expect <<EOF
87
d423f8c refs/notes/commits@{0}: notes: Notes added by 'git notes add'
88
EOF