summaryrefslogtreecommitdiff
path: root/builtin/clean.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2017-08-11 13:26:58 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-08-11 13:26:58 -0700
commite72ecd324c54675ddf20ecb7b303ad5ec88f6301 (patch)
tree33fc3d9042e85c0dd3507c3c1fd4a323ba04d8a9 /builtin/clean.c
parentMerge branch 'jk/ref-filter-colors' (diff)
parentclean.c: use designated initializer (diff)
downloadtgif-e72ecd324c54675ddf20ecb7b303ad5ec88f6301.tar.xz
Merge branch 'jk/c99'
Start using selected c99 constructs in small, stable and essentialpart of the system to catch people who care about older compilers that do not grok them. * jk/c99: clean.c: use designated initializer strbuf: use designated initializers in STRBUF_INIT
Diffstat (limited to 'builtin/clean.c')
-rw-r--r--builtin/clean.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/builtin/clean.c b/builtin/clean.c
index c1bafda5b6..21a7a32994 100644
--- a/builtin/clean.c
+++ b/builtin/clean.c
@@ -33,15 +33,6 @@ static const char *msg_skip_git_dir = N_("Skipping repository %s\n");
static const char *msg_would_skip_git_dir = N_("Would skip repository %s\n");
static const char *msg_warn_remove_failed = N_("failed to remove %s");
-static int clean_use_color = -1;
-static char clean_colors[][COLOR_MAXLEN] = {
- GIT_COLOR_RESET,
- GIT_COLOR_NORMAL, /* PLAIN */
- GIT_COLOR_BOLD_BLUE, /* PROMPT */
- GIT_COLOR_BOLD, /* HEADER */
- GIT_COLOR_BOLD_RED, /* HELP */
- GIT_COLOR_BOLD_RED, /* ERROR */
-};
enum color_clean {
CLEAN_COLOR_RESET = 0,
CLEAN_COLOR_PLAIN = 1,
@@ -51,6 +42,16 @@ enum color_clean {
CLEAN_COLOR_ERROR = 5
};
+static int clean_use_color = -1;
+static char clean_colors[][COLOR_MAXLEN] = {
+ [CLEAN_COLOR_ERROR] = GIT_COLOR_BOLD_RED,
+ [CLEAN_COLOR_HEADER] = GIT_COLOR_BOLD,
+ [CLEAN_COLOR_HELP] = GIT_COLOR_BOLD_RED,
+ [CLEAN_COLOR_PLAIN] = GIT_COLOR_NORMAL,
+ [CLEAN_COLOR_PROMPT] = GIT_COLOR_BOLD_BLUE,
+ [CLEAN_COLOR_RESET] = GIT_COLOR_RESET,
+};
+
#define MENU_OPTS_SINGLETON 01
#define MENU_OPTS_IMMEDIATE 02
#define MENU_OPTS_LIST_ONLY 04