summaryrefslogtreecommitdiff
path: root/compat/mingw.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2018-10-30 18:40:06 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-10-31 03:46:27 (GMT)
commitbdfbb0ea932d1ec479474cc7928ec9d47ea89e7b (patch)
treeba8768c1a1b10c12f8ae954616b68c49302bfa05 /compat/mingw.c
parent70fc5793dfdf8ba8586ca130674f6896eb3eb37a (diff)
downloadgit-bdfbb0ea932d1ec479474cc7928ec9d47ea89e7b.zip
git-bdfbb0ea932d1ec479474cc7928ec9d47ea89e7b.tar.gz
git-bdfbb0ea932d1ec479474cc7928ec9d47ea89e7b.tar.bz2
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>
Diffstat (limited to 'compat/mingw.c')
-rw-r--r--compat/mingw.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index 293f286..272d5e1 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -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;
}