[PATCH] Work around sed portability issue in t8006-blame-textconv

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In test 'blame --textconv with local changes' of t8006-blame-textconv,
using /usr/xpg4/bin/sed on Solaris as set by SANE_TOOL_PATH, an
additional newline was added to the output from the 'helper' script
driven by git attributes.

This was noted by sed with a message such as:
sed: Missing newline at end of file zero.bin.

In turn, this was triggering a fatal error from git blame:
fatal: unable to read files to diff

The git blame --textconv stdout was empty as a result of the error
condition above.  This caused the test to fail because the output
value differed from the expected result.

Use perl -p -e instead of sed -e to work around this portability issue
as it will not insert the newline.  This allows the git blame call to
complete at which point the output comparison is successful.

Signed-off-by: Ben Walton <bwalton@xxxxxxxxxxxxxxxxxx>
---
 t/t8006-blame-textconv.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/t/t8006-blame-textconv.sh b/t/t8006-blame-textconv.sh
index 4ee42f1..c3c22f7 100755
--- a/t/t8006-blame-textconv.sh
+++ b/t/t8006-blame-textconv.sh
@@ -10,7 +10,7 @@ find_blame() {
 cat >helper <<'EOF'
 #!/bin/sh
 grep -q '^bin: ' "$1" || { echo "E: $1 is not \"binary\" file" 1>&2; exit 1; }
-sed 's/^bin: /converted: /' "$1"
+perl -p -e 's/^bin: /converted: /' "$1"
 EOF
 chmod +x helper
 
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]