From 45972ffbedf8175555434006595c71a5b0e643f1 Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Thu, 16 Apr 2009 10:20:44 +0200 Subject: [PATCH] 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 --- remote.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/remote.c b/remote.c index a06761ace..54230ad55 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", -- 2.30.2