author | Junio C Hamano <gitster@pobox.com> | |
Fri, 18 Jul 2008 04:30:33 +0000 (21:30 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 18 Jul 2008 05:13:19 +0000 (22:13 -0700) | ||
commit | 72972eb3749daecf328badbc1c1952cb513f34f9 | |
tree | 0bf1f338bb1458c4f232ed3e59b3aa97ef83c8d9 | tree | snapshot |
parent | 1b76ead0044c865cc005ea2d8d2aeec526632810 | commit | diff |
builtin-remote.c: fix earlier "skip_prefix()" conversion
The original code relied on an insane definition of skip_prefix() that
returned an empty string for a NULL input and returned the original if the
given "prefix" is not a prefix at all (it would have been justifiable if
it were called "come_up_with_a_short_name_to_report_ref()" or something,
though). In any case, when we replaced it with a more saner definition of
the function whose behaviour is true to its name, its callers needed to be
adjusted but the conversion missed one call site.
This introduces a helper function "abbrev_ref()" whose purpose is to get a
full refname and its possible prefix and to strip the prefix part if it
matches, or refname itself in full if it doesn't. This makes the callers
easier to read again.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The original code relied on an insane definition of skip_prefix() that
returned an empty string for a NULL input and returned the original if the
given "prefix" is not a prefix at all (it would have been justifiable if
it were called "come_up_with_a_short_name_to_report_ref()" or something,
though). In any case, when we replaced it with a more saner definition of
the function whose behaviour is true to its name, its callers needed to be
adjusted but the conversion missed one call site.
This introduces a helper function "abbrev_ref()" whose purpose is to get a
full refname and its possible prefix and to strip the prefix part if it
matches, or refname itself in full if it doesn't. This makes the callers
easier to read again.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-remote.c | diff | blob | history |