t4062: use less than 256 repetitions in regex
OpenBSD's regex library has a repetition limit (RE_DUP_MAX) of 255. That's the minimum acceptable value according to POSIX. In t4062 we use 4096 repetitions in the test "-G matches", though, causing it to fail. Combine two repetition operators, both less than 256, to arrive at 4096 zeros instead of using a single one, to fix the test on OpenBSD. Original-patch-by: David Coppa <dcoppa@openbsd.org> Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe committed
Aug 9, 2017 at 16:15 UTC
4c7fda8fc1d67481100b8d4e39f9ff6ff878639e
1 file changed
+3
-1
t/t4062-diff-pickaxe.sh
+3
-1
@@ -14,8 +14,10 @@ test_expect_success setup '
14
test_tick &&
15
git commit -m "A 4k file"
16
'
17
+
18
+# OpenBSD only supports up to 255 repetitions, so repeat twice for 64*64=4096.
19
test_expect_success '-G matches' '
18
- git diff --name-only -G "^0{4096}$" HEAD^ >out &&
20
+ git diff --name-only -G "^(0{64}){64}$" HEAD^ >out &&
21
test 4096-zeroes.txt = "$(cat out)"
22
'
23