diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-12-05 14:11:11 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-12-05 14:11:20 -0800 |
commit | 15a42a10ec71eb18983750562a2a8a43b224fef0 (patch) | |
tree | 2c208dd06917ffc4361cee469bfd3d9b7e5405cb /builtin/branch.c | |
parent | bb5d531efa804bbf09064e4a7ce65e096599f3c7 (diff) | |
parent | d2446dfd7f3b3f8948142cfb07a0270e2497d93f (diff) | |
download | git-jk/remove-deprecated.tar.gz |
Sync with 1.8.5jk/remove-deprecated
Diffstat (limited to 'builtin/branch.c')
-rw-r--r-- | builtin/branch.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/builtin/branch.c b/builtin/branch.c index 5696cf0ef7..f157f92f48 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -424,6 +424,7 @@ static void fill_tracking_info(struct strbuf *stat, const char *branch_name, struct branch *branch = branch_get(branch_name); struct strbuf fancy = STRBUF_INIT; int upstream_is_gone = 0; + int added_decoration = 1; switch (stat_tracking_info(branch, &ours, &theirs)) { case 0: @@ -451,9 +452,13 @@ static void fill_tracking_info(struct strbuf *stat, const char *branch_name, if (upstream_is_gone) { if (show_upstream_ref) strbuf_addf(stat, _("[%s: gone]"), fancy.buf); + else + added_decoration = 0; } else if (!ours && !theirs) { if (show_upstream_ref) strbuf_addf(stat, _("[%s]"), fancy.buf); + else + added_decoration = 0; } else if (!ours) { if (show_upstream_ref) strbuf_addf(stat, _("[%s: behind %d]"), fancy.buf, theirs); @@ -474,7 +479,8 @@ static void fill_tracking_info(struct strbuf *stat, const char *branch_name, ours, theirs); } strbuf_release(&fancy); - strbuf_addch(stat, ' '); + if (added_decoration) + strbuf_addch(stat, ' '); free(ref); } |