Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:05:43

Paul Tan [off-list ref] 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().
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help