diff --git a/cache.h b/cache.h index e6c7f3307d..f591437a50 100644 --- a/cache.h +++ b/cache.h @@ -518,6 +518,7 @@ extern size_t delta_base_cache_limit; extern int auto_crlf; extern int fsync_object_files; extern int core_preload_index; +extern int hide_dotfiles; enum safe_crlf { SAFE_CRLF_FALSE = 0, diff --git a/compat/mingw.c b/compat/mingw.c index c3f5cef22c..665d861389 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -130,8 +130,9 @@ static int make_hidden(const char *path) #undef mkdir int mingw_mkdir(const char *path, int mode) { + extern int hide_dotfiles; int ret = mkdir(path); - if (!ret) { + if (!ret && hide_dotfiles) { /* * In Windows a file or dir starting with a dot is not * automatically hidden. So lets mark it as hidden when diff --git a/config.c b/config.c index 738b24419d..fc45ea2198 100644 --- a/config.c +++ b/config.c @@ -505,6 +505,11 @@ static int git_default_core_config(const char *var, const char *value) return 0; } + if (!strcmp(var, "core.hidedotfiles")) { + hide_dotfiles = git_config_bool(var, value); + return 0; + } + /* Add other config variables here and to Documentation/config.txt. */ return 0; } diff --git a/environment.c b/environment.c index 8f5eaa7dd8..940f3cfa3a 100644 --- a/environment.c +++ b/environment.c @@ -48,6 +48,7 @@ enum push_default_type push_default = PUSH_DEFAULT_MATCHING; #endif enum object_creation_mode object_creation_mode = OBJECT_CREATION_MODE; int grafts_replace_parents = 1; +int hide_dotfiles = 1; /* Parallel index stat data preload? */ int core_preload_index = 0;