зеркало из https://github.com/microsoft/git.git
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>
This commit is contained in:
Родитель
a45d34691e
Коммит
45972ffbed
6
remote.c
6
remote.c
|
@ -1461,11 +1461,7 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
base = branch->merge[0]->dst;
|
base = branch->merge[0]->dst;
|
||||||
if (!prefixcmp(base, "refs/remotes/")) {
|
base = shorten_unambiguous_ref(base, 0);
|
||||||
base += strlen("refs/remotes/");
|
|
||||||
} else if (!prefixcmp(base, "refs/heads/")) {
|
|
||||||
base += strlen("refs/heads/");
|
|
||||||
}
|
|
||||||
if (!num_theirs)
|
if (!num_theirs)
|
||||||
strbuf_addf(sb, "Your branch is ahead of '%s' "
|
strbuf_addf(sb, "Your branch is ahead of '%s' "
|
||||||
"by %d commit%s.\n",
|
"by %d commit%s.\n",
|
||||||
|
|
Загрузка…
Ссылка в новой задаче