@matheusbsbs / matheus-bagliano / commits / 74bb2dfbec
Fork 0

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>

Arjen Laarhoven committed Feb 13, 2009 at 22:53 UTC 74bb2dfbec15ad47242b9a879b5547b6f4a28318
1 file changed +16 -16
builtin-branch.c
+16 -16
@@ -39,11 +39,11 @@ static char branch_colors[][COLOR_MAXLEN] = {
39 GIT_COLOR_GREEN, /* CURRENT */
40 };
41 enum color_branch {
42 - COLOR_BRANCH_RESET = 0,
43 - COLOR_BRANCH_PLAIN = 1,
44 - COLOR_BRANCH_REMOTE = 2,
45 - COLOR_BRANCH_LOCAL = 3,
46 - COLOR_BRANCH_CURRENT = 4,
42 + BRANCH_COLOR_RESET = 0,
43 + BRANCH_COLOR_PLAIN = 1,
44 + BRANCH_COLOR_REMOTE = 2,
45 + BRANCH_COLOR_LOCAL = 3,
46 + BRANCH_COLOR_CURRENT = 4,
47 };
48
49 static enum merge_filter {
@@ -56,15 +56,15 @@ static unsigned char merge_filter_ref[20];
56 static int parse_branch_color_slot(const char *var, int ofs)
57 {
58 if (!strcasecmp(var+ofs, "plain"))
59 - return COLOR_BRANCH_PLAIN;
59 + return BRANCH_COLOR_PLAIN;
60 if (!strcasecmp(var+ofs, "reset"))
61 - return COLOR_BRANCH_RESET;
61 + return BRANCH_COLOR_RESET;
62 if (!strcasecmp(var+ofs, "remote"))
63 - return COLOR_BRANCH_REMOTE;
63 + return BRANCH_COLOR_REMOTE;
64 if (!strcasecmp(var+ofs, "local"))
65 - return COLOR_BRANCH_LOCAL;
65 + return BRANCH_COLOR_LOCAL;
66 if (!strcasecmp(var+ofs, "current"))
67 - return COLOR_BRANCH_CURRENT;
67 + return BRANCH_COLOR_CURRENT;
68 die("bad config variable '%s'", var);
69 }
70
@@ -303,20 +303,20 @@ static void print_ref_item(struct ref_item *item, int maxwidth, int verbose,
303
304 switch (item->kind) {
305 case REF_LOCAL_BRANCH:
306 - color = COLOR_BRANCH_LOCAL;
306 + color = BRANCH_COLOR_LOCAL;
307 break;
308 case REF_REMOTE_BRANCH:
309 - color = COLOR_BRANCH_REMOTE;
309 + color = BRANCH_COLOR_REMOTE;
310 break;
311 default:
312 - color = COLOR_BRANCH_PLAIN;
312 + color = BRANCH_COLOR_PLAIN;
313 break;
314 }
315
316 c = ' ';
317 if (current) {
318 c = '*';
319 - color = COLOR_BRANCH_CURRENT;
319 + color = BRANCH_COLOR_CURRENT;
320 }
321
322 if (verbose) {
@@ -335,14 +335,14 @@ static void print_ref_item(struct ref_item *item, int maxwidth, int verbose,
335
336 printf("%c %s%-*s%s %s %s%s\n", c, branch_get_color(color),
337 maxwidth, item->name,
338 - branch_get_color(COLOR_BRANCH_RESET),
338 + branch_get_color(BRANCH_COLOR_RESET),
339 find_unique_abbrev(item->commit->object.sha1, abbrev),
340 stat.buf, sub);
341 strbuf_release(&stat);
342 strbuf_release(&subject);
343 } else {
344 printf("%c %s%s%s\n", c, branch_get_color(color), item->name,
345 - branch_get_color(COLOR_BRANCH_RESET));
345 + branch_get_color(BRANCH_COLOR_RESET));
346 }
347 }
348