builtin-branch.c: Rename branch category color names
The branch color constants have the form COLOR_BRANCH_$category. Rename them to BRANCH_COLOR_$category as this conveys their meaning better. Signed-off-by: Arjen Laarhoven <arjen@yaph.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
dc6ebd4cc5
commit
74bb2dfbec
@ -39,11 +39,11 @@ static char branch_colors[][COLOR_MAXLEN] = {
|
|||||||
GIT_COLOR_GREEN, /* CURRENT */
|
GIT_COLOR_GREEN, /* CURRENT */
|
||||||
};
|
};
|
||||||
enum color_branch {
|
enum color_branch {
|
||||||
COLOR_BRANCH_RESET = 0,
|
BRANCH_COLOR_RESET = 0,
|
||||||
COLOR_BRANCH_PLAIN = 1,
|
BRANCH_COLOR_PLAIN = 1,
|
||||||
COLOR_BRANCH_REMOTE = 2,
|
BRANCH_COLOR_REMOTE = 2,
|
||||||
COLOR_BRANCH_LOCAL = 3,
|
BRANCH_COLOR_LOCAL = 3,
|
||||||
COLOR_BRANCH_CURRENT = 4,
|
BRANCH_COLOR_CURRENT = 4,
|
||||||
};
|
};
|
||||||
|
|
||||||
static enum merge_filter {
|
static enum merge_filter {
|
||||||
@ -56,15 +56,15 @@ static unsigned char merge_filter_ref[20];
|
|||||||
static int parse_branch_color_slot(const char *var, int ofs)
|
static int parse_branch_color_slot(const char *var, int ofs)
|
||||||
{
|
{
|
||||||
if (!strcasecmp(var+ofs, "plain"))
|
if (!strcasecmp(var+ofs, "plain"))
|
||||||
return COLOR_BRANCH_PLAIN;
|
return BRANCH_COLOR_PLAIN;
|
||||||
if (!strcasecmp(var+ofs, "reset"))
|
if (!strcasecmp(var+ofs, "reset"))
|
||||||
return COLOR_BRANCH_RESET;
|
return BRANCH_COLOR_RESET;
|
||||||
if (!strcasecmp(var+ofs, "remote"))
|
if (!strcasecmp(var+ofs, "remote"))
|
||||||
return COLOR_BRANCH_REMOTE;
|
return BRANCH_COLOR_REMOTE;
|
||||||
if (!strcasecmp(var+ofs, "local"))
|
if (!strcasecmp(var+ofs, "local"))
|
||||||
return COLOR_BRANCH_LOCAL;
|
return BRANCH_COLOR_LOCAL;
|
||||||
if (!strcasecmp(var+ofs, "current"))
|
if (!strcasecmp(var+ofs, "current"))
|
||||||
return COLOR_BRANCH_CURRENT;
|
return BRANCH_COLOR_CURRENT;
|
||||||
die("bad config variable '%s'", var);
|
die("bad config variable '%s'", var);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -303,20 +303,20 @@ static void print_ref_item(struct ref_item *item, int maxwidth, int verbose,
|
|||||||
|
|
||||||
switch (item->kind) {
|
switch (item->kind) {
|
||||||
case REF_LOCAL_BRANCH:
|
case REF_LOCAL_BRANCH:
|
||||||
color = COLOR_BRANCH_LOCAL;
|
color = BRANCH_COLOR_LOCAL;
|
||||||
break;
|
break;
|
||||||
case REF_REMOTE_BRANCH:
|
case REF_REMOTE_BRANCH:
|
||||||
color = COLOR_BRANCH_REMOTE;
|
color = BRANCH_COLOR_REMOTE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
color = COLOR_BRANCH_PLAIN;
|
color = BRANCH_COLOR_PLAIN;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
c = ' ';
|
c = ' ';
|
||||||
if (current) {
|
if (current) {
|
||||||
c = '*';
|
c = '*';
|
||||||
color = COLOR_BRANCH_CURRENT;
|
color = BRANCH_COLOR_CURRENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
@ -335,14 +335,14 @@ static void print_ref_item(struct ref_item *item, int maxwidth, int verbose,
|
|||||||
|
|
||||||
printf("%c %s%-*s%s %s %s%s\n", c, branch_get_color(color),
|
printf("%c %s%-*s%s %s %s%s\n", c, branch_get_color(color),
|
||||||
maxwidth, item->name,
|
maxwidth, item->name,
|
||||||
branch_get_color(COLOR_BRANCH_RESET),
|
branch_get_color(BRANCH_COLOR_RESET),
|
||||||
find_unique_abbrev(item->commit->object.sha1, abbrev),
|
find_unique_abbrev(item->commit->object.sha1, abbrev),
|
||||||
stat.buf, sub);
|
stat.buf, sub);
|
||||||
strbuf_release(&stat);
|
strbuf_release(&stat);
|
||||||
strbuf_release(&subject);
|
strbuf_release(&subject);
|
||||||
} else {
|
} else {
|
||||||
printf("%c %s%s%s\n", c, branch_get_color(color), item->name,
|
printf("%c %s%s%s\n", c, branch_get_color(color), item->name,
|
||||||
branch_get_color(COLOR_BRANCH_RESET));
|
branch_get_color(BRANCH_COLOR_RESET));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user