summaryrefslogtreecommitdiff
path: root/t/t4062-diff-pickaxe.sh
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2017-08-09 14:15:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-08-09 16:46:18 (GMT)
commit4c7fda8fc1d67481100b8d4e39f9ff6ff878639e (patch)
treeeffe40b60977978d3969e874ab74b447ed227669 /t/t4062-diff-pickaxe.sh
parent840ed141983718e0c5518a325534a5656797132a (diff)
downloadgit-4c7fda8fc1d67481100b8d4e39f9ff6ff878639e.zip
git-4c7fda8fc1d67481100b8d4e39f9ff6ff878639e.tar.gz
git-4c7fda8fc1d67481100b8d4e39f9ff6ff878639e.tar.bz2
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>
Diffstat (limited to 't/t4062-diff-pickaxe.sh')
-rwxr-xr-xt/t4062-diff-pickaxe.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/t/t4062-diff-pickaxe.sh b/t/t4062-diff-pickaxe.sh
index f0bf50b..9f3ce4b 100755
--- a/t/t4062-diff-pickaxe.sh
+++ b/t/t4062-diff-pickaxe.sh
@@ -14,8 +14,10 @@ test_expect_success setup '
test_tick &&
git commit -m "A 4k file"
'
+
+# OpenBSD only supports up to 255 repetitions, so repeat twice for 64*64=4096.
test_expect_success '-G matches' '
- git diff --name-only -G "^0{4096}$" HEAD^ >out &&
+ git diff --name-only -G "^(0{64}){64}$" HEAD^ >out &&
test 4096-zeroes.txt = "$(cat out)"
'