On Fri, Sep 30, 2022 at 01:23:27PM -0400, Derrick Stolee wrote: > > - const char *head_ref = resolve_ref_unsafe("HEAD", > > + const char *head_ref = xstrdup_or_null(resolve_ref_unsafe("HEAD", > > RESOLVE_REF_READING, > > NULL, > > - NULL); > > + NULL)); > > Moving to a 'char *' matches our typical pattern of "I am responsible > for freeing this or passing that responsibility to someone else." Do we really have such a misleading pattern? To me 'char*', as opposed to 'const char*', means that "I'll modify the buffer where this pointer points to, and I must be on the lookout for when and how that happens".