Subject: Re: [PATCH v5 00/44] Make git-am a builtin

From: Junio C Hamano <[email-masked]>
Date: Wed, 08 Jul 2015 23:00:52 -0700

Paul Tan <[email-masked]> writes:

> So the fix would be to remove the assert()s, as follows:

What I pushed out tonight should have SQUASH??? (or fixup!) that
splits this into appropriate steps in your series.  Please check.

Note that you do not have to say "if the variable has something,
then free it".  free(NULL) is perfectly fine and we can read

	free(var);
        var = compute_new_value();

just fine.

However, I am reluctant to blindly replace assert(!state->field)
with free(state->field).  Are there cases where we _must_ call a
function that sets these fields at most once?

On the other hand, assert() like this is more or less useless.

	assert(state->field);
        ...
        printf("%s", state->field); /* or other uses */

"The caller must have filled the field" can be seen by unconditional
use of "state->field" without such an assert().