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:
authorJeff King <peff@peff.net>2017-07-09 12:59:33 +0300
committerJunio C Hamano <gitster@pobox.com>2017-07-09 19:24:42 +0300
commit34d820ee336598d93f1fa619f517811ee0ef503d (patch)
tree96cb741c3d5ae524696dcbfec8aeaa45bb4dfded /builtin
parenta5b3663898d6e45a5d109ce89c516adc2fd4ded2 (diff)
branch: use BRANCH_COLOR_LOCAL in ref-filter format
Since 949af0684 (branch: use ref-filter printing APIs, 2017-01-10), git-branch's output is generated by passing a custom format to the ref-filter code. This format forgot to pass BRANCH_COLOR_LOCAL, meaning that local branches (besides the current one) were never colored at all. We can add it in the %(if) block where we decide whether the branch is "current" or merely "local". Note that this means the current/local coloring is either/or. You can't set: [color "branch"] local = blue current = bold and expect the current branch to be "bold blue". This matches the pre-949af0684 behavior. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/branch.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/branch.c b/builtin/branch.c
index 5f8b5ada8e..b660ec558e 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -331,8 +331,9 @@ static char *build_format(struct ref_filter *filter, int maxwidth, const char *r
struct strbuf local = STRBUF_INIT;
struct strbuf remote = STRBUF_INIT;
- strbuf_addf(&local, "%%(if)%%(HEAD)%%(then)* %s%%(else) %%(end)",
- branch_get_color(BRANCH_COLOR_CURRENT));
+ strbuf_addf(&local, "%%(if)%%(HEAD)%%(then)* %s%%(else) %s%%(end)",
+ branch_get_color(BRANCH_COLOR_CURRENT),
+ branch_get_color(BRANCH_COLOR_LOCAL));
strbuf_addf(&remote, " ");
if (filter->verbose) {