From 45972ffbedf8175555434006595c71a5b0e643f1 Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Thu, 16 Apr 2009 10:20:44 +0200 Subject: remote.c: use shorten_unambiguous_ref Use the new shorten_unambiguous_ref() for simplifying the output of upstream branch names. This affects status and checkout. Signed-off-by: Michael J Gruber Signed-off-by: Junio C Hamano diff --git a/remote.c b/remote.c index a06761a..54230ad 100644 --- a/remote.c +++ b/remote.c @@ -1461,11 +1461,7 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb) return 0; base = branch->merge[0]->dst; - if (!prefixcmp(base, "refs/remotes/")) { - base += strlen("refs/remotes/"); - } else if (!prefixcmp(base, "refs/heads/")) { - base += strlen("refs/heads/"); - } + base = shorten_unambiguous_ref(base, 0); if (!num_theirs) strbuf_addf(sb, "Your branch is ahead of '%s' " "by %d commit%s.\n", -- cgit v0.10.2-6-g49f6