config: move Windows-specific config settings into compat/mingw.c

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Oct 30, 2018 at 11:40 UTC bdfbb0ea932d1ec479474cc7928ec9d47ea89e7b
4 files changed +18 -17
cache.h
-8
@@ -906,14 +906,6 @@ int use_optional_locks(void);
906 extern char comment_line_char;
907 extern int auto_comment_line_char;
908
909 -/* Windows only */
910 -enum hide_dotfiles_type {
911 - HIDE_DOTFILES_FALSE = 0,
912 - HIDE_DOTFILES_TRUE,
913 - HIDE_DOTFILES_DOTGITONLY
914 -};
915 -extern enum hide_dotfiles_type hide_dotfiles;
916 -
909 enum log_refs_config {
910 LOG_REFS_UNSET = -1,
911 LOG_REFS_NONE = 0,
compat/mingw.c
+18
@@ -6,6 +6,7 @@
6 #include "../run-command.h"
7 #include "../cache.h"
8 #include "win32/lazyload.h"
9 +#include "../config.h"
10
11 #define HCAST(type, handle) ((type)(intptr_t)handle)
12
@@ -203,8 +204,25 @@ static int ask_yes_no_if_possible(const char *format, ...)
204 }
205 }
206
207 +/* Windows only */
208 +enum hide_dotfiles_type {
209 + HIDE_DOTFILES_FALSE = 0,
210 + HIDE_DOTFILES_TRUE,
211 + HIDE_DOTFILES_DOTGITONLY
212 +};
213 +
214 +static enum hide_dotfiles_type hide_dotfiles = HIDE_DOTFILES_DOTGITONLY;
215 +
216 int mingw_core_config(const char *var, const char *value, void *cb)
217 {
218 + if (!strcmp(var, "core.hidedotfiles")) {
219 + if (value && !strcasecmp(value, "dotgitonly"))
220 + hide_dotfiles = HIDE_DOTFILES_DOTGITONLY;
221 + else
222 + hide_dotfiles = git_config_bool(var, value);
223 + return 0;
224 + }
225 +
226 return 0;
227 }
228
config.c
-8
@@ -1344,14 +1344,6 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
1344 return 0;
1345 }
1346
1347 - if (!strcmp(var, "core.hidedotfiles")) {
1348 - if (value && !strcasecmp(value, "dotgitonly"))
1349 - hide_dotfiles = HIDE_DOTFILES_DOTGITONLY;
1350 - else
1351 - hide_dotfiles = git_config_bool(var, value);
1352 - return 0;
1353 - }
1354 -
1347 if (!strcmp(var, "core.partialclonefilter")) {
1348 return git_config_string(&core_partial_clone_filter_default,
1349 var, value);
environment.c
-1
@@ -71,7 +71,6 @@ int core_apply_sparse_checkout;
71 int merge_log_config = -1;
72 int precomposed_unicode = -1; /* see probe_utf8_pathname_composition() */
73 unsigned long pack_size_limit_cfg;
74 -enum hide_dotfiles_type hide_dotfiles = HIDE_DOTFILES_DOTGITONLY;
74 enum log_refs_config log_all_ref_updates = LOG_REFS_UNSET;
75
76 #ifndef PROTECT_HFS_DEFAULT