]> granicus.if.org Git - git/commitdiff
config: move Windows-specific config settings into compat/mingw.c
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Tue, 30 Oct 2018 18:40:06 +0000 (11:40 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 31 Oct 2018 03:46:27 +0000 (12:46 +0900)
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h
compat/mingw.c
config.c
environment.c

diff --git a/cache.h b/cache.h
index f7fabdde8f37d857f6160c0e4798788f1963d3ae..0ce95c5a8d72ed2d573d97bfae00ab06b2daafaa 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -906,14 +906,6 @@ int use_optional_locks(void);
 extern char comment_line_char;
 extern int auto_comment_line_char;
 
-/* Windows only */
-enum hide_dotfiles_type {
-       HIDE_DOTFILES_FALSE = 0,
-       HIDE_DOTFILES_TRUE,
-       HIDE_DOTFILES_DOTGITONLY
-};
-extern enum hide_dotfiles_type hide_dotfiles;
-
 enum log_refs_config {
        LOG_REFS_UNSET = -1,
        LOG_REFS_NONE = 0,
index 293f286af1990566208d9a3b38503d9a3657edfb..272d5e11eabf87516bbf492443f50791e803996b 100644 (file)
@@ -6,6 +6,7 @@
 #include "../run-command.h"
 #include "../cache.h"
 #include "win32/lazyload.h"
+#include "../config.h"
 
 #define HCAST(type, handle) ((type)(intptr_t)handle)
 
@@ -203,8 +204,25 @@ static int ask_yes_no_if_possible(const char *format, ...)
        }
 }
 
+/* Windows only */
+enum hide_dotfiles_type {
+       HIDE_DOTFILES_FALSE = 0,
+       HIDE_DOTFILES_TRUE,
+       HIDE_DOTFILES_DOTGITONLY
+};
+
+static enum hide_dotfiles_type hide_dotfiles = HIDE_DOTFILES_DOTGITONLY;
+
 int mingw_core_config(const char *var, const char *value, void *cb)
 {
+       if (!strcmp(var, "core.hidedotfiles")) {
+               if (value && !strcasecmp(value, "dotgitonly"))
+                       hide_dotfiles = HIDE_DOTFILES_DOTGITONLY;
+               else
+                       hide_dotfiles = git_config_bool(var, value);
+               return 0;
+       }
+
        return 0;
 }
 
index 646b6cca96b79bd557de18cbd2cc9bdb0c50c6e0..5bf19a23c2db169aa27bb954c2c0f3d3bb4ff613 100644 (file)
--- a/config.c
+++ b/config.c
@@ -1344,14 +1344,6 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
                return 0;
        }
 
-       if (!strcmp(var, "core.hidedotfiles")) {
-               if (value && !strcasecmp(value, "dotgitonly"))
-                       hide_dotfiles = HIDE_DOTFILES_DOTGITONLY;
-               else
-                       hide_dotfiles = git_config_bool(var, value);
-               return 0;
-       }
-
        if (!strcmp(var, "core.partialclonefilter")) {
                return git_config_string(&core_partial_clone_filter_default,
                                         var, value);
index 3f3c8746c2b6e30c5d9e40772078a39c3a9638c8..30ecd4e784019bbf2059b2a0b69c43289cbc3d24 100644 (file)
@@ -71,7 +71,6 @@ int core_apply_sparse_checkout;
 int merge_log_config = -1;
 int precomposed_unicode = -1; /* see probe_utf8_pathname_composition() */
 unsigned long pack_size_limit_cfg;
-enum hide_dotfiles_type hide_dotfiles = HIDE_DOTFILES_DOTGITONLY;
 enum log_refs_config log_all_ref_updates = LOG_REFS_UNSET;
 
 #ifndef PROTECT_HFS_DEFAULT