mirror of
https://github.com/git/git.git
synced 2025-01-19 05:53:31 +08:00
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>
This commit is contained in:
parent
ac9b24015c
commit
31625b34c0
@ -279,4 +279,35 @@ test_expect_success 'describe ignoring a borken submodule' '
|
||||
grep broken out
|
||||
'
|
||||
|
||||
# we require ulimit, this excludes Windows
|
||||
test_expect_failure ULIMIT_STACK_SIZE 'name-rev works in a deep repo' '
|
||||
i=1 &&
|
||||
while test $i -lt 8000
|
||||
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^ &&
|
||||
echo "HEAD~4000 tags/far-far-away~3999" >expect &&
|
||||
git name-rev HEAD~4000 >actual &&
|
||||
test_cmp expect actual &&
|
||||
run_with_limited_stack git name-rev HEAD~4000 >actual &&
|
||||
test_cmp expect actual
|
||||
'
|
||||
|
||||
test_expect_success ULIMIT_STACK_SIZE 'describe works in a deep repo' '
|
||||
git tag -f far-far-away HEAD~7999 &&
|
||||
echo "far-far-away" >expect &&
|
||||
git describe --tags --abbrev=0 HEAD~4000 >actual &&
|
||||
test_cmp expect actual &&
|
||||
run_with_limited_stack git describe --tags --abbrev=0 HEAD~4000 >actual &&
|
||||
test_cmp expect actual
|
||||
'
|
||||
|
||||
test_done
|
||||
|
Loading…
Reference in New Issue
Block a user