diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-07-16 17:42:48 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-07-16 17:42:48 -0700 |
commit | 1fb34456580d2556e370bed1ba86fdc8c985ffe6 (patch) | |
tree | bd92e1f78749a711f918c22acbc0c208fd05be4e /builtin | |
parent | Merge branch 'ab/fetch-negotiate-segv-fix' (diff) | |
parent | show-branch tests: add missing tests (diff) | |
download | tgif-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.c | 9 |
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(' '); } |