Skip to content

Commit 636db2c

Browse files
committed
t3301: add tests to use --format="%N"
Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5b16360 commit 636db2c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

t/t3301-notes.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ test_expect_success 'handle empty notes gracefully' '
5555
git notes show ; test 1 = $?
5656
'
5757

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+
5867
test_expect_success 'create notes' '
5968
git config core.notesRef refs/notes/commits &&
6069
MSG=b4 git notes add &&
@@ -65,6 +74,15 @@ test_expect_success 'create notes' '
6574
test_must_fail git notes show HEAD^
6675
'
6776

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+
6886
cat >expect <<EOF
6987
d423f8c refs/notes/commits@{0}: notes: Notes added by 'git notes add'
7088
EOF

0 commit comments

Comments
 (0)