Skip to content

Commit 4c502d6

Browse files
committed
tests: make sure input to sed is newline terminated
POSIX only requires sed to work on text files and because it does not end with a newline, this commit's content is not a text file. Add a newline to fix it. Without this change, OS X sed helpfully adds a newline to actual.message, causing t9010.13 to fail. Reported-by: Torsten Bögershausen <[email protected]> Tested-by: Brian Gernhardt <[email protected]> Signed-off-by: Jonathan Nieder <[email protected]>
1 parent 41e6b91 commit 4c502d6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

t/t9010-svn-fe.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ test_expect_success 'NUL in log message, file content, and property name' '
407407
OBJID
408408
:000000 100644 OBJID OBJID A greeting
409409
EOF
410-
printf "\n%s" "something with an ASCII NUL (Q)" >expect.message &&
410+
printf "\n%s\n" "something with an ASCII NUL (Q)" >expect.message &&
411411
printf "%s\n" "helQo" >expect.hello1 &&
412412
printf "%s\n" "link hello" >expect.hello2 &&
413413
{
@@ -465,7 +465,11 @@ test_expect_success 'NUL in log message, file content, and property name' '
465465
git diff-tree --root --stdin |
466466
sed "s/$_x40/OBJID/g"
467467
} >actual &&
468-
git cat-file commit HEAD | nul_to_q | sed -ne "/^\$/,\$ p" >actual.message &&
468+
{
469+
git cat-file commit HEAD | nul_to_q &&
470+
echo
471+
} |
472+
sed -ne "/^\$/,\$ p" >actual.message &&
469473
git cat-file blob HEAD^:greeting | nul_to_q >actual.hello1 &&
470474
git cat-file blob HEAD:greeting | nul_to_q >actual.hello2 &&
471475
test_cmp expect actual &&

0 commit comments

Comments
 (0)