• J
    make get_short_ref a public function · 7c2b3029
    Jeff King 提交于
    Often we want to shorten a full ref name to something "prettier"
    to show a user. For example, "refs/heads/master" is often shown
    simply as "master", or "refs/remotes/origin/master" is shown as
    "origin/master".
    
    Many places in the code use a very simple formula: skip common
    prefixes like refs/heads, refs/remotes, etc. This is codified in
    the prettify_ref function.
    
    for-each-ref has a more correct (but more expensive) approach:
    consider the ref lookup rules, and try shortening as much as
    possible while remaining unambiguous.
    
    This patch makes the latter strategy globally available as
    shorten_unambiguous_ref.
    Signed-off-by: NJeff King <peff@peff.net>
    Signed-off-by: NJunio C Hamano <gitster@pobox.com>
    7c2b3029
refs.c 41.6 KB