Skip to content

Commit

Permalink
t5704: fix nonportable sed/grep usages
Browse files Browse the repository at this point in the history
OS X's sed and grep would complain with (respectively)

  sed: 1: "/^-/{p;q}": extra characters at the end of q command
  grep: Regular expression too big

For sed, use an explicit ; to terminate the q command.

For grep, spell the "40 hex digits" explicitly in the regex, which
should be safe as other tests already use this and we haven't got
breakage reports on OS X about them.

Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Thomas Rast authored and Junio C Hamano committed Mar 6, 2012
1 parent 80a3f53 commit 0dbe659
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions t/t5704-bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ test_expect_success 'ridiculously long subject in boundary' '
git bundle list-heads long-subject-bundle.bdl >heads &&
test -s heads &&
git fetch long-subject-bundle.bdl &&
sed -n "/^-/{p;q}" long-subject-bundle.bdl >boundary &&
grep "^-$_x40 " boundary
sed -n "/^-/{p;q;}" long-subject-bundle.bdl >boundary &&
grep "^-[0-9a-f]\\{40\\} " boundary
'

test_done

0 comments on commit 0dbe659

Please sign in to comment.