Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-07-17 03:42:48 +0300
committerJunio C Hamano <gitster@pobox.com>2021-07-17 03:42:48 +0300
commit1fb34456580d2556e370bed1ba86fdc8c985ffe6 (patch)
treebd92e1f78749a711f918c22acbc0c208fd05be4e /builtin
parentb2fc8226294e52c7f08533b202f2b90ce72b7eaf (diff)
parentd65aea37d9b3dd64e29aeb0727c6141f264ce24e (diff)
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(' ');
}