config.c: avoid duplicated global static variables
authorJohannes Sixt <j6t@kdbg.org>
Tue, 9 Aug 2016 14:16:33 +0000 (16:16 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 9 Aug 2016 17:19:24 +0000 (10:19 -0700)
Repeating the definition of a static variable seems to be valid in C.
Nevertheless, it is bad style because it can cause confusion, definitely
when it becomes necessary to change the type.

d64ec16 (git config: reorganize to use parseopt, 2009-02-21) added two
static variables near the top of the file config.c without removing the
definitions of the two variables that occurs later in the file.

The two variables were needed earlier in the file in the newly
introduced parseopt structure. These references were removed later in
d0e08d6 (config: fix parsing of "git config --get-color some.key -1",
2014-11-20).

Remove the redundant, younger, definitions near the top of the file and
keep the original definitions that occur later.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/config.c
index a58f99c2d78f8e06a2e9df7af155af7aa8eaf4c8..e4d96313d79d8ca8dede8f89becaa2b94f909d24 100644 (file)
@@ -23,7 +23,6 @@ static char term = '\n';
 static int use_global_config, use_system_config, use_local_config;
 static struct git_config_source given_config_source;
 static int actions, types;
-static const char *get_color_slot, *get_colorbool_slot;
 static int end_null;
 static int respect_includes = -1;