Subject: Re: [PATCH v6 15/16] Ensure that the output buffer is released after calling merge_trees()

From: Junio C Hamano <[email-masked]>
Date: Thu, 04 Aug 2016 11:18:23 -0700

Johannes Schindelin <[email-masked]> writes:

> The recursive merge machinery accumulates its output in an output
> buffer, to be flushed at the end of merge_recursive(). At this point,
> we forgot to release the output buffer.
> ...
> diff --git a/merge-recursive.c b/merge-recursive.c
> index ec50932..9e527de 100644
> --- a/merge-recursive.c
> +++ b/merge-recursive.c
> @@ -2078,6 +2078,8 @@ int merge_recursive(struct merge_options *o,
>  		commit_list_insert(h2, &(*result)->parents->next);
>  	}
>  	flush_output(o);
> +	if (!o->call_depth && o->buffer_output < 2)
> +		strbuf_release(&o->obuf);

OK, with !o->call_depth the change makes sense to me.