summaryrefslogtreecommitdiff
path: root/t/t3301-notes.sh
diff options
context:
space:
mode:
authorTor Arne Vestbø <tavestbo@trolltech.com>2009-01-13 20:57:16 +0100
committerJunio C Hamano <gitster@pobox.com>2009-01-14 14:54:41 -0800
commit22a3d060937072b0f197a8084af879c753c68fe7 (patch)
tree9675025a5567dd28d27b4bdad0ccf8320a085cc9 /t/t3301-notes.sh
parentbb1dff9def343a7d513eea8f4eaa5fd7d5d3fc5f (diff)
downloadgit-22a3d060937072b0f197a8084af879c753c68fe7.tar.gz
git-notes: fix printing of multi-line notes
The line length was read from the same position every time, causing mangled output when printing notes with multiple lines. Also, adding new-line manually for each line ensures that we get a new-line between commits, matching git-log for commits without notes. Signed-off-by: Tor Arne Vestbø <tavestbo@trolltech.com> Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3301-notes.sh')
-rwxr-xr-xt/t3301-notes.sh32
1 files changed, 31 insertions, 1 deletions
diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh
index ba42c45ec4..9393a25511 100755
--- a/t/t3301-notes.sh
+++ b/t/t3301-notes.sh
@@ -59,7 +59,37 @@ EOF
test_expect_success 'show notes' '
! (git cat-file commit HEAD | grep b1) &&
git log -1 > output &&
- git diff expect output
+ test_cmp expect output
+'
+test_expect_success 'create multi-line notes (setup)' '
+ : > a3 &&
+ git add a3 &&
+ test_tick &&
+ git commit -m 3rd &&
+ MSG="b3
+c3c3c3c3
+d3d3d3" git notes edit
+'
+
+cat > expect-multiline << EOF
+commit 1584215f1d29c65e99c6c6848626553fdd07fd75
+Author: A U Thor <author@example.com>
+Date: Thu Apr 7 15:15:13 2005 -0700
+
+ 3rd
+
+Notes:
+ b3
+ c3c3c3c3
+ d3d3d3
+EOF
+
+printf "\n" >> expect-multiline
+cat expect >> expect-multiline
+
+test_expect_success 'show multi-line notes' '
+ git log -2 > output &&
+ test_cmp expect-multiline output
'
test_done