summaryrefslogtreecommitdiff
path: root/transport.c
diff options
context:
space:
mode:
authorJiang Xin <zhiyou.jx@alibaba-inc.com>2020-08-27 15:45:42 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-08-27 19:47:47 (GMT)
commit917c612512cd4523f5587870547ee5369aa4632d (patch)
tree227809fd3e71d683b522d390f1efff68008ab223 /transport.c
parentb34789c0b0d3b137f0bb516b417bd8d75e0cb306 (diff)
downloadgit-917c612512cd4523f5587870547ee5369aa4632d.zip
git-917c612512cd4523f5587870547ee5369aa4632d.tar.gz
git-917c612512cd4523f5587870547ee5369aa4632d.tar.bz2
transport: not report a non-head push as a branch
When pushing a new reference (not a head or tag), report it as a new reference instead of a new branch. Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'transport.c')
-rw-r--r--transport.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/transport.c b/transport.c
index 15f5ba4..26fefd1 100644
--- a/transport.c
+++ b/transport.c
@@ -500,9 +500,12 @@ static void print_ok_ref_status(struct ref *ref, int porcelain, int summary_widt
porcelain, summary_width);
else if (is_null_oid(&ref->old_oid))
print_ref_status('*',
- (starts_with(ref->name, "refs/tags/") ? "[new tag]" :
- "[new branch]"),
- ref, ref->peer_ref, NULL, porcelain, summary_width);
+ (starts_with(ref->name, "refs/tags/")
+ ? "[new tag]"
+ : (starts_with(ref->name, "refs/heads/")
+ ? "[new branch]"
+ : "[new reference]")),
+ ref, ref->peer_ref, NULL, porcelain, summary_width);
else {
struct strbuf quickref = STRBUF_INIT;
char type;