mirror of
https://github.com/git/git.git
synced 2026-04-01 12:30:09 +02:00
Make auto-hiding dot-files optional on Windows.
Although a file starting with a dot usually ought to be hidden, there could be reasons users do not want it to happen automatically. Original patch by Erik Faye-Lund. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Acked-by: Johannes Sixt <j6t@kdbg.org>
This commit is contained in:
committed by
Johannes Schindelin
parent
33dc23c8d1
commit
250c0f4ea5
1
cache.h
1
cache.h
@@ -525,6 +525,7 @@ extern int auto_crlf;
|
||||
extern int read_replace_refs;
|
||||
extern int fsync_object_files;
|
||||
extern int core_preload_index;
|
||||
extern int hide_dotfiles;
|
||||
|
||||
enum safe_crlf {
|
||||
SAFE_CRLF_FALSE = 0,
|
||||
|
||||
@@ -131,8 +131,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
|
||||
|
||||
5
config.c
5
config.c
@@ -503,6 +503,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;
|
||||
}
|
||||
|
||||
@@ -50,6 +50,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;
|
||||
|
||||
Reference in New Issue
Block a user