summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-06-03 19:06:44 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-06-03 19:06:44 (GMT)
commit59e0821a81fd82e8aafb8a581d2f001a4ec3e33d (patch)
treef7e4311a84e543bf3c1d52c2c12f8fe4fec945cf /t
parent0b4494625d97088afe95845b4c69dc16af8c62e9 (diff)
parentcbc60b67201e083a4970c8731c5382a575357e36 (diff)
downloadgit-59e0821a81fd82e8aafb8a581d2f001a4ec3e33d.zip
git-59e0821a81fd82e8aafb8a581d2f001a4ec3e33d.tar.gz
git-59e0821a81fd82e8aafb8a581d2f001a4ec3e33d.tar.bz2
Merge branch 'sk/tag-contains-wo-recursion'
* sk/tag-contains-wo-recursion: git tag --contains: avoid stack overflow
Diffstat (limited to 't')
-rwxr-xr-xt/t7004-tag.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index 143a8ea..e4ab0f5 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -1423,4 +1423,30 @@ EOF
test_cmp expect actual
'
+run_with_limited_stack () {
+ (ulimit -s 64 && "$@")
+}
+
+test_lazy_prereq ULIMIT 'run_with_limited_stack true'
+
+# we require ulimit, this excludes Windows
+test_expect_success ULIMIT '--contains works in a deep repo' '
+ >expect &&
+ i=1 &&
+ while test $i -lt 4000
+ do
+ echo "commit refs/heads/master
+committer A U Thor <author@example.com> $((1000000000 + $i * 100)) +0200
+data <<EOF
+commit #$i
+EOF"
+ test $i = 1 && echo "from refs/heads/master^0"
+ i=$(($i + 1))
+ done | git fast-import &&
+ git checkout master &&
+ git tag far-far-away HEAD^ &&
+ run_with_limited_stack git tag --contains HEAD >actual &&
+ test_cmp expect actual
+'
+
test_done