summaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorMichael J Gruber <git@drmicha.warpmail.net>2009-04-16 08:20:44 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-04-18 03:53:19 (GMT)
commit45972ffbedf8175555434006595c71a5b0e643f1 (patch)
tree9e41ccd917c54ab0af0b9df8b97b3ef2e53a53e5 /remote.c
parenta45d34691ea624e93863e95706eeb1b1909304f3 (diff)
downloadgit-45972ffbedf8175555434006595c71a5b0e643f1.zip
git-45972ffbedf8175555434006595c71a5b0e643f1.tar.gz
git-45972ffbedf8175555434006595c71a5b0e643f1.tar.bz2
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 <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c6
1 files changed, 1 insertions, 5 deletions
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",