diff options
author | Jeff King <peff@peff.net> | 2009-04-07 03:05:01 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-04-07 22:06:12 -0700 |
commit | 3d4ecc0e23b2b2f555e7d33b5623fd4e67cc2ac7 (patch) | |
tree | a5396d12050e280137d24c286e2471aa0f974f9c /t/t4013/diff.log_-SF_-p_master | |
parent | Merge branch 'jc/name-branch' (diff) | |
download | tgif-3d4ecc0e23b2b2f555e7d33b5623fd4e67cc2ac7.tar.xz |
for-each-ref: refactor get_short_ref function
This function took a "refinfo" object which is unnecessarily
restrictive; it only ever looked at the refname field. This
patch refactors it to take just the ref name as a string.
While we're touching the relevant lines, let's give it
consistent memory semantics. Previously, some code paths
would return an allocated string and some would return the
original string; now it will always return a malloc'd
string.
This doesn't actually fix a bug or a leak, because
for-each-ref doesn't clean up its memory, but it makes the
function a lot less surprising for reuse (which will
happen in a later patch).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4013/diff.log_-SF_-p_master')
0 files changed, 0 insertions, 0 deletions