Skip to content

Commit 476a4df

Browse files
dstosbergJunio C Hamano
authored andcommitted
Make t8001-annotate and t8002-blame more portable
These two tests assume that "sed" will not modify the final line of a stream if it does not end with a newline character. The assumption is not true at least for FreeBSD and Solaris 9. FreeBSD's "sed" appends a newline character; "sed" in Solaris 9 even removes the incomplete final line. This patch makes the test use perl instead. Signed-off-by: Dennis Stosberg <dennis@stosberg.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 3e4339e commit 476a4df

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

t/annotate-tests.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,7 @@ test_expect_success \
111111

112112
test_expect_success \
113113
'some edit' \
114-
'mv file file1 &&
115-
sed -e 1d -e "5s/3A/99/" file1 >file &&
116-
rm -f file1 &&
114+
'perl -pi -e "s/^1A.*\n$//; s/^3A/99/" file &&
117115
GIT_AUTHOR_NAME="D" git commit -a -m "edit"'
118116

119117
test_expect_success \

0 commit comments

Comments
 (0)