t1450: use egrep for regexp "alternation"
authorJunio C Hamano <gitster@pobox.com>
Wed, 28 Jun 2017 17:17:04 +0000 (10:17 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 28 Jun 2017 17:17:50 +0000 (10:17 -0700)
GNU grep allows "\(A\|B\)" as alternation in BRE, but this is an
extension not understood by some other implementations of grep
(Michael Kebe reported an breakage on Solaris).

Rewrite the offending test to ERE and use egrep instead.

Noticed-by: Michael Kebe <michael.kebe@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1450-fsck.sh
index 8f52da2771c0a26c08b943cf7b9596c5e14afb7d..30e217dea22375dbe9a113e18fbb14fa6c89cecd 100755 (executable)
@@ -541,7 +541,7 @@ test_expect_success 'fsck --name-objects' '
                remove_loose_object $(git rev-parse julius:caesar.t) &&
                test_must_fail git fsck --name-objects >out &&
                tree=$(git rev-parse --verify julius:) &&
-               grep "$tree (\(refs/heads/master\|HEAD\)@{[0-9]*}:" out
+               egrep "$tree \((refs/heads/master|HEAD)@\{[0-9]*\}:" out
        )
 '