[PATCH] Use 'grep -a' to fix some errors with non-GNU grep(1).
This fixes test errors on OpenBSD.
Signed-off-by: Bernd Ahlers <bernd@ba-net.org>
---
t/t4019-diff-wserror.sh | 28 ++++++++++++++--------------
t/t9200-git-cvsexportcommit.sh | 2 +-
2 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/t/t4019-diff-wserror.sh b/t/t4019-diff-wserror.sh
index 0d9cbb6..275b41a 100755
--- a/t/t4019-diff-wserror.sh
+++ b/t/t4019-diff-wserror.sh
@@ -22,8 +22,8 @@ blue_grep='7;34m' ;# ESC [ 7 ; 3 4 m
test_expect_success default '
git diff --color >output
- grep "$blue_grep" output >error
- grep -v "$blue_grep" output >normal
+ grep -a "$blue_grep" output >error
+ grep -a -v "$blue_grep" output >normal
grep Eight normal >/dev/null &&
grep HT error >/dev/null &&
@@ -37,8 +37,8 @@ test_expect_success 'without -trail' '
git config core.whitespace -trail
git diff --color >output
- grep "$blue_grep" output >error
- grep -v "$blue_grep" output >normal
+ grep -a "$blue_grep" output >error
+ grep -a -v "$blue_grep" output >normal
grep Eight normal >/dev/null &&
grep HT error >/dev/null &&
@@ -53,8 +53,8 @@ test_expect_success 'without -trail (attribute)' '
git config --unset core.whitespace
echo "F whitespace=-trail" >.gitattributes
git diff --color >output
- grep "$blue_grep" output >error
- grep -v "$blue_grep" output >normal
+ grep -a "$blue_grep" output >error
+ grep -a -v "$blue_grep" output >normal
grep Eight normal >/dev/null &&
grep HT error >/dev/null &&
@@ -69,8 +69,8 @@ test_expect_success 'without -space' '
rm -f .gitattributes
git config core.whitespace -space
git diff --color >output
- grep "$blue_grep" output >error
- grep -v "$blue_grep" output >normal
+ grep -a "$blue_grep" output >error
+ grep -a -v "$blue_grep" output >normal
grep Eight normal >/dev/null &&
grep HT normal >/dev/null &&
@@ -85,8 +85,8 @@ test_expect_success 'without -space (attribute)' '
git config --unset core.whitespace
echo "F whitespace=-space" >.gitattributes
git diff --color >output
- grep "$blue_grep" output >error
- grep -v "$blue_grep" output >normal
+ grep -a "$blue_grep" output >error
+ grep -a -v "$blue_grep" output >normal
grep Eight normal >/dev/null &&
grep HT normal >/dev/null &&
@@ -101,8 +101,8 @@ test_expect_success 'with indent-non-tab only' '
rm -f .gitattributes
git config core.whitespace indent,-trailing,-space
git diff --color >output
- grep "$blue_grep" output >error
- grep -v "$blue_grep" output >normal
+ grep -a "$blue_grep" output >error
+ grep -a -v "$blue_grep" output >normal
grep Eight error >/dev/null &&
grep HT normal >/dev/null &&
@@ -117,8 +117,8 @@ test_expect_success 'with indent-non-tab only (attribute)' '
git config --unset core.whitespace
echo "F whitespace=indent,-trailing,-space" >.gitattributes
git diff --color >output
- grep "$blue_grep" output >error
- grep -v "$blue_grep" output >normal
+ grep -a "$blue_grep" output >error
+ grep -a -v "$blue_grep" output >normal
grep Eight error >/dev/null &&
grep HT normal >/dev/null &&
diff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh
index 42b144b..d3bd48c 100755
--- a/t/t9200-git-cvsexportcommit.sh
+++ b/t/t9200-git-cvsexportcommit.sh
@@ -30,7 +30,7 @@ exit 1
check_entries () {
# $1 == directory, $2 == expected
- grep '^/' "$1/CVS/Entries" | sort | cut -d/ -f2,3,5 >actual
+ grep -a '^/' "$1/CVS/Entries" | sort | cut -d/ -f2,3,5 >actual
if test -z "$2"
then
>expected
--
1.5.4.5