diff options
author | Jeff King <peff@peff.net> | 2008-03-12 17:32:17 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-03-13 00:57:52 -0700 |
commit | aadbe44f883859536c5320e0ac1d6ed122c45671 (patch) | |
tree | 5552c7d0999106d0198ed59403b21dcc1c5111e6 /t/t9400-git-cvsserver-server.sh | |
parent | e85fe4d85bc7654af20ccf8054ab6922665405e5 (diff) | |
download | git-aadbe44f883859536c5320e0ac1d6ed122c45671.tar.gz |
grep portability fix: don't use "-e" or "-q"
System V versions of grep (such as Solaris /usr/bin/grep)
don't understand either of these options. git's usage of
"grep -e pattern" fell into one of two categories:
1. equivalent to "grep pattern". -e is only useful here if
the pattern begins with a "-", but all of the patterns
are hardcoded and do not begin with a dash.
2. stripping comments and blank lines with
grep -v -e "^$" -e "^#"
We can fortunately do this in the affirmative as
grep '^[^#]'
Uses of "-q" can be replaced with redirection to /dev/null.
In many tests, however, "grep -q" is used as "if this string
is in the expected output, we are OK". In this case, it is
fine to just remove the "-q" entirely; it simply makes the
"verbose" mode of the test slightly more verbose.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9400-git-cvsserver-server.sh')
-rwxr-xr-x | t/t9400-git-cvsserver-server.sh | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh index 0a20971ebb..e82b365fad 100755 --- a/t/t9400-git-cvsserver-server.sh +++ b/t/t9400-git-cvsserver-server.sh @@ -94,7 +94,7 @@ EOF test_expect_success 'pserver authentication' \ 'cat request-anonymous | git-cvsserver pserver >log 2>&1 && - tail -n1 log | grep -q "^I LOVE YOU$"' + tail -n1 log | grep "^I LOVE YOU$"' test_expect_success 'pserver authentication failure (non-anonymous user)' \ 'if cat request-git | git-cvsserver pserver >log 2>&1 @@ -103,11 +103,11 @@ test_expect_success 'pserver authentication failure (non-anonymous user)' \ else true fi && - tail -n1 log | grep -q "^I HATE YOU$"' + tail -n1 log | grep "^I HATE YOU$"' test_expect_success 'pserver authentication (login)' \ 'cat login-anonymous | git-cvsserver pserver >log 2>&1 && - tail -n1 log | grep -q "^I LOVE YOU$"' + tail -n1 log | grep "^I LOVE YOU$"' test_expect_success 'pserver authentication failure (login/non-anonymous user)' \ 'if cat login-git | git-cvsserver pserver >log 2>&1 @@ -116,7 +116,7 @@ test_expect_success 'pserver authentication failure (login/non-anonymous user)' else true fi && - tail -n1 log | grep -q "^I HATE YOU$"' + tail -n1 log | grep "^I HATE YOU$"' # misuse pserver authentication for testing of req_Root @@ -146,15 +146,15 @@ test_expect_success 'req_Root failure (relative pathname)' \ else true fi && - tail log | grep -q "^error 1 Root must be an absolute pathname$"' + tail log | grep "^error 1 Root must be an absolute pathname$"' test_expect_success 'req_Root failure (conflicting roots)' \ 'cat request-conflict | git-cvsserver pserver >log 2>&1 && - tail log | grep -q "^error 1 Conflicting roots specified$"' + tail log | grep "^error 1 Conflicting roots specified$"' test_expect_success 'req_Root (strict paths)' \ 'cat request-anonymous | git-cvsserver --strict-paths pserver $SERVERDIR >log 2>&1 && - tail -n1 log | grep -q "^I LOVE YOU$"' + tail -n1 log | grep "^I LOVE YOU$"' test_expect_success 'req_Root failure (strict-paths)' ' ! cat request-anonymous | @@ -163,7 +163,7 @@ test_expect_success 'req_Root failure (strict-paths)' ' test_expect_success 'req_Root (w/o strict-paths)' \ 'cat request-anonymous | git-cvsserver pserver $WORKDIR/ >log 2>&1 && - tail -n1 log | grep -q "^I LOVE YOU$"' + tail -n1 log | grep "^I LOVE YOU$"' test_expect_success 'req_Root failure (w/o strict-paths)' ' ! cat request-anonymous | @@ -181,7 +181,7 @@ EOF test_expect_success 'req_Root (base-path)' \ 'cat request-base | git-cvsserver --strict-paths --base-path $WORKDIR/ pserver $SERVERDIR >log 2>&1 && - tail -n1 log | grep -q "^I LOVE YOU$"' + tail -n1 log | grep "^I LOVE YOU$"' test_expect_success 'req_Root failure (base-path)' ' ! cat request-anonymous | @@ -192,14 +192,14 @@ GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled false || exit 1 test_expect_success 'req_Root (export-all)' \ 'cat request-anonymous | git-cvsserver --export-all pserver $WORKDIR >log 2>&1 && - tail -n1 log | grep -q "^I LOVE YOU$"' + tail -n1 log | grep "^I LOVE YOU$"' test_expect_success 'req_Root failure (export-all w/o whitelist)' \ '! (cat request-anonymous | git-cvsserver --export-all pserver >log 2>&1 || false)' test_expect_success 'req_Root (everything together)' \ 'cat request-base | git-cvsserver --export-all --strict-paths --base-path $WORKDIR/ pserver $SERVERDIR >log 2>&1 && - tail -n1 log | grep -q "^I LOVE YOU$"' + tail -n1 log | grep "^I LOVE YOU$"' GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true || exit 1 @@ -216,7 +216,7 @@ test_expect_success 'gitcvs.enabled = false' \ else true fi && - cat cvs.log | grep -q "GITCVS emulation disabled" && + grep "GITCVS emulation disabled" cvs.log && test ! -d cvswork2' rm -fr cvswork2 @@ -237,7 +237,7 @@ test_expect_success 'gitcvs.ext.enabled = false' \ else true fi && - cat cvs.log | grep -q "GITCVS emulation disabled" && + grep "GITCVS emulation disabled" cvs.log && test ! -d cvswork2' rm -fr cvswork2 |