Skip to contentSkip to conversation

t1450: use egrep for regexp "alternation"

PATCH New Junio C Hamano 1 participant 1 message Jun 28, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 t1450: use egrep for regexp "alternation"

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.

---
 t/t1450-fsck.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
t/t1450-fsck.sh +1 -1
index 8f52da2771..30e217dea2 100755
@@ -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
 	)
 '
 
Signature · 1 line
2.13.2-655-gbf99380098