summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2021-07-16 17:42:48 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-07-16 17:42:48 -0700
commit1fb34456580d2556e370bed1ba86fdc8c985ffe6 (patch)
treebd92e1f78749a711f918c22acbc0c208fd05be4e /builtin
parentMerge branch 'ab/fetch-negotiate-segv-fix' (diff)
parentshow-branch tests: add missing tests (diff)
downloadtgif-1fb34456580d2556e370bed1ba86fdc8c985ffe6.tar.xz
Merge branch 'ab/show-branch-tests'
Fill test gaps. * ab/show-branch-tests: show-branch tests: add missing tests show-branch: don't <COLOR></RESET> for space characters show-branch tests: modernize test code show-branch tests: rename the one "show-branch" test file
Diffstat (limited to 'builtin')
-rw-r--r--builtin/show-branch.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/builtin/show-branch.c b/builtin/show-branch.c
index d6d2dabeca..d77ce7aeb3 100644
--- a/builtin/show-branch.c
+++ b/builtin/show-branch.c
@@ -939,9 +939,12 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
mark = '*';
else
mark = '+';
- printf("%s%c%s",
- get_color_code(i),
- mark, get_color_reset_code());
+ if (mark == ' ')
+ putchar(mark);
+ else
+ printf("%s%c%s",
+ get_color_code(i),
+ mark, get_color_reset_code());
}
putchar(' ');
}