From: Junio C Hamano Date: Sat, 15 Oct 2011 05:44:48 GMT Subject: Re: [PATCH 5/8] t9901: fix line-ending dependency on windows Message-ID: <7vsjmux0z3.fsf@alter.siamese.dyndns.org> In-Reply-To: <1318632815-29945-6-git-send-email-patthoyts@users.sourceforge.net> Pat Thoyts writes: > Signed-off-by: Pat Thoyts > --- > t/t9901-git-web--browse.sh | 10 +++++----- > 1 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/t/t9901-git-web--browse.sh b/t/t9901-git-web--browse.sh > index 7906e5d..1185b42 100755 > --- a/t/t9901-git-web--browse.sh > +++ b/t/t9901-git-web--browse.sh > @@ -12,7 +12,7 @@ test_expect_success \ > echo http://example.com/foo\&bar >expect && > git config browser.custom.cmd echo && > git web--browse --browser=custom \ > - http://example.com/foo\&bar >actual && > + http://example.com/foo\&bar | tr -d "\r" >actual && > test_cmp expect actual > ' This is unnice for two reasons. We have web--browse five times in this test script, and you add tr exactly the same way to each and every one of them. And you are losing the error condition from each and every one of these web--browse invocations. Having to do the same change to all invocations of the same command suggests that perhaps you can and should wrap that pattern into a single helper, perhaps like: test_web_browse () { # browser=$1 url=$2 git web--browse --browser="$1" "$2" >actual && tr -d '\015' text && test_cmp expect text } or something?