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>
Michael J Gruber committed
Apr 16, 2009 at 10:20 UTC
45972ffbedf8175555434006595c71a5b0e643f1
1 file changed
+1
-5
remote.c
+1
-5
@@ -1461,11 +1461,7 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb)
1461
return 0;
1462
1463
base = branch->merge[0]->dst;
1464
- if (!prefixcmp(base, "refs/remotes/")) {
1465
- base += strlen("refs/remotes/");
1466
- } else if (!prefixcmp(base, "refs/heads/")) {
1467
- base += strlen("refs/heads/");
1468
- }
1464
+ base = shorten_unambiguous_ref(base, 0);
1465
if (!num_theirs)
1466
strbuf_addf(sb, "Your branch is ahead of '%s' "
1467
"by %d commit%s.\n",