@matheusbsbs / matheus-bagliano / commits / d8b69ecb4c
Fork 0

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 <gitster@pobox.com>

Brandon Casey committed May 6, 2009 at 13:29 UTC d8b69ecb4c467c044c08e0435bb22ade16ea580f
1 file changed +4 -1
t/annotate-tests.sh
+4 -1
@@ -114,7 +114,10 @@ test_expect_success \
114 test_expect_success \
115 'some edit' \
116 '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 &&
121 echo "incomplete" | tr -d "\\012" >>file &&
122 GIT_AUTHOR_NAME="D" git commit -a -m "edit"'
123