t6120: test describe and name-rev with deep repos
Depending on the implementation of walks, limitted stack size may lead to problems (for recursion). Test name-rev and describe with deep repos and limitted stack size and mark the former with known failure. We add these tests (which add gazillions of commits) last so as to keep the runtime of other subtests the same. Signed-off-by: Michael J Gruber <git@grubix.eu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael J Gruber committed
Sep 7, 2017 at 16:02 UTC
31625b34c0e54ae184f28aa5eb5095d21204557e
1 file changed
+31
t/t6120-describe.sh
+31
@@ -279,4 +279,35 @@ test_expect_success 'describe ignoring a borken submodule' '
279
grep broken out
280
'
281
282
+# we require ulimit, this excludes Windows
283
+test_expect_failure ULIMIT_STACK_SIZE 'name-rev works in a deep repo' '
284
+ i=1 &&
285
+ while test $i -lt 8000
286
+ do
287
+ echo "commit refs/heads/master
288
+committer A U Thor <author@example.com> $((1000000000 + $i * 100)) +0200
289
+data <<EOF
290
+commit #$i
291
+EOF"
292
+ test $i = 1 && echo "from refs/heads/master^0"
293
+ i=$(($i + 1))
294
+ done | git fast-import &&
295
+ git checkout master &&
296
+ git tag far-far-away HEAD^ &&
297
+ echo "HEAD~4000 tags/far-far-away~3999" >expect &&
298
+ git name-rev HEAD~4000 >actual &&
299
+ test_cmp expect actual &&
300
+ run_with_limited_stack git name-rev HEAD~4000 >actual &&
301
+ test_cmp expect actual
302
+'
303
+
304
+test_expect_success ULIMIT_STACK_SIZE 'describe works in a deep repo' '
305
+ git tag -f far-far-away HEAD~7999 &&
306
+ echo "far-far-away" >expect &&
307
+ git describe --tags --abbrev=0 HEAD~4000 >actual &&
308
+ test_cmp expect actual &&
309
+ run_with_limited_stack git describe --tags --abbrev=0 HEAD~4000 >actual &&
310
+ test_cmp expect actual
311
+'
312
+
313
test_done