Re: [PATCH 2/3] commit: add function to unparse a commit and its parents
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- May 25, 2009, 09:17 UTC
- Message-ID
- <4A1A621E.10703@viscovery.net>
- In-Reply-To
- <20090517153647.6403.44036.chriscool@tuxfamily.org>
Christian Couder schrieb:
Show 19 quoted lines
> +static void unparse_commit_list(struct commit_list *list)
> +{
> + for (; list; list = list->next)
> + unparse_commit(list->item);
> +}
> +
> +void unparse_commit(struct commit *item)
> +{
> + item->object.flags = 0;
> + item->object.used = 0;
> + if (item->object.parsed) {
> + item->object.parsed = 0;
> + if (item->parents) {
> + unparse_commit_list(item->parents);
> + free_commit_list(item->parents);
> + item->parents = NULL;
> + }
> + }
> +}I see a recursion here. Could this not overflow the stack if there is a long ancestry chain?
-- Hannes