Skip to content

Commit d8b69ec

Browse files
drafnelgitster
authored andcommitted
t/annotate-tests.sh: avoid passing a non-newline terminated file to sed
Some versions of sed exit non-zero if the file they are supplied is not newline terminated. Solaris's /usr/xpg4/bin/sed is one such sed. So rework this test to avoid doing so. This affects tests t8001-annotate.sh and t8002-blame.sh. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 325fb15 commit d8b69ec

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

t/annotate-tests.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,10 @@ test_expect_success \
114114
test_expect_success \
115115
'some edit' \
116116
'mv file file.orig &&
117-
sed -e "s/^3A/99/" -e "/^1A/d" -e "/^incomplete/d" < file.orig > file &&
117+
{
118+
cat file.orig &&
119+
echo
120+
} | sed -e "s/^3A/99/" -e "/^1A/d" -e "/^incomplete/d" > file &&
118121
echo "incomplete" | tr -d "\\012" >>file &&
119122
GIT_AUTHOR_NAME="D" git commit -a -m "edit"'
120123

0 commit comments

Comments
 (0)