git tag --contains : avoid stack overflow
commitf172da6b28eb7008f68f313f10f1ee84e4e01c2a
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>
Sat, 10 May 2014 21:56:49 +0000 (10 16:56 -0500)
tree8bd741f1c77119f679e44529f2dae193d3626240
parent4e4b3c742b2cc3a2a17cffb565fbfda026f0b4bd
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