Thread (4 messages) 4 messages, 3 authors, 2016-06-15

Re: [PATCH v2] git tag --contains : avoid stack overflow

flat view

From: Stepan Kasal <hidden>
Date: 2016-06-15 23:00:49
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help