summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-11-18 12:24:49 -0800
committerJunio C Hamano <gitster@pobox.com>2013-11-18 12:24:49 -0800
commitab930f02961bd4cce9b3dd5049c6eabd07ca03a8 (patch)
tree773140cf2f2ebbf83436f0957104a9a248b16854 /builtin
parent03973056a08d1694cf1c819eb2e8b9557650f70e (diff)
parent6b364d48f2e72d6c37115e6aa4fe769a523dd1d4 (diff)
downloadgit-ab930f02961bd4cce9b3dd5049c6eabd07ca03a8.tar.gz
Merge branch 'jx/branch-vv-always-compare-with-upstream'
Hot-fix for a regression. * jx/branch-vv-always-compare-with-upstream: branch: fix --verbose output column alignment
Diffstat (limited to 'builtin')
-rw-r--r--builtin/branch.c8
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);
}