提交 45972ffb 编写于 作者: M Michael J Gruber 提交者: Junio C Hamano

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: NMichael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 a45d3469
......@@ -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",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册