git tag --contains : avoid stack overflow
commit2a276c819e8baf49a52bc50e3cb060ee92f64bbd
authorJean-Jacques Lafay <jeanjacques.lafay@gmail.com>
Sat, 10 Nov 2012 17:36:10 +0000 (10 18:36 +0100)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Thu, 10 Apr 2014 18:53:48 +0000 (10 13:53 -0500)
tree71590c97c6a2807f3a3c777726914d976dedd86c
parent081255ffc07e406bd5be24ef1a1b140c4ffa0196
git tag --contains : avoid stack overflow

In large repos, the recursion implementation of contains(commit,
commit_list) may result in a stack overflow. Replace the recursion with
a loop to fix it.

This problem is more apparent on Windows than on Linux, where the stack
is more limited by default.

See also this thread on the msysGit list:

https://groups.google.com/d/topic/msysgit/FqT6boJrb2g/discussion

[jes: re-written to imitate the original recursion more closely]

Signed-off-by: Jean-Jacques Lafay <jeanjacques.lafay@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Tested-by: Stepan Kasal <kasal@ucw.cz>
builtin/tag.c
t/t7004-tag.sh