Skip to content
  • Brandon Casey's avatar
    sha1_name.c: avoid unnecessary strbuf_release · b45a09c4
    Brandon Casey authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    When we fall back to a standard for_each_reflog_ent() after failing to find
    the nth branch switch (or if we had a short reflog) with the call to
    for_each_recent_reflog_ent(), we do not need to free the memory allocated
    for our strbuf's since a strbuf_reset() will be performed in
    grab_nth_branch_switch() before assigning to the entry.
    
    Plus, the strbuf_release() negates the non-zero hint we initially gave to
    strbuf_init() just above these lines.
    
    Signed-off-by: default avatarBrandon Casey <drafnel@gmail.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    b45a09c4