Jeff King [off-list ref] writes:
On Wed, Jan 14, 2015 at 09:22:52AM -0800, Junio C Hamano wrote:
...
quoted
And the result should merge just fine to 'maint'.
Are we in agreement then that the resulting code with the helper is
actually easier to read? I think replacing the straight ?: lines is, but
I am on the fence on whether:
const char *x = some_fun(...);
return xstrdup_or_null(x);
is better or worse than:
return xstrdup_or_null(some_fun(....));
I think the latter is fine as long as some_fun(...) invocation does
not get overly long, and even the longest I saw in refs.c, i.e.
return xstrdup_or_null(resolve_ref_unsafe(ref, resolve_flags, sha1, flags));
did not bother me too much.