Skip to content

Commit

Permalink
t/annotate-tests.sh: avoid passing a non-newline terminated file to sed
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Brandon Casey authored and Junio C Hamano committed May 6, 2009
1 parent 325fb15 commit d8b69ec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion t/annotate-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ test_expect_success \
test_expect_success \
'some edit' \
'mv file file.orig &&
sed -e "s/^3A/99/" -e "/^1A/d" -e "/^incomplete/d" < file.orig > file &&
{
cat file.orig &&
echo
} | sed -e "s/^3A/99/" -e "/^1A/d" -e "/^incomplete/d" > file &&
echo "incomplete" | tr -d "\\012" >>file &&
GIT_AUTHOR_NAME="D" git commit -a -m "edit"'

Expand Down

0 comments on commit d8b69ec

Please sign in to comment.