Thanks for all suggestions and explanations.
The diff against PATCH v2 is below, PATCH v3 follows.

Have a nice day,
        Stepan

Subject: [PATCH] fixup! git tag --contains : avoid stack overflow

---
 t/t7004-tag.sh | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index db82f6d..a911df0 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -1423,12 +1423,15 @@ EOF
        test_cmp expect actual
 '
 
-ulimit_stack="ulimit -s 64"
-test_lazy_prereq ULIMIT 'bash -c "'"$ulimit_stack"'"'
+run_with_limited_stack () {
+       (ulimit -s 64 && "$@")
+}
+
+test_lazy_prereq ULIMIT 'run_with_limited_stack true'
 
->expect
 # we require bash and ulimit, this excludes Windows
 test_expect_success ULIMIT '--contains works in a deep repo' '
+       >expect &&
        i=1 &&
        while test $i -lt 4000
        do
@@ -1442,7 +1445,7 @@ EOF"
        done | git fast-import &&
        git checkout master &&
        git tag far-far-away HEAD^ &&
-       bash -c "'"$ulimit_stack"' && git tag --contains HEAD >actual" &&
+       run_with_limited_stack git tag --contains HEAD >actual &&
        test_cmp expect actual
 '
 
-- 
1.9.0.msysgit.0.119.g722efef

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to