Skip to content

Commit 314b31b

Browse files
committed
Move Windows-specific config settings into compat/mingw.c
Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 5a8a41a commit 314b31b

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

cache.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -721,14 +721,6 @@ extern int ref_paranoia;
721721
extern char comment_line_char;
722722
extern int auto_comment_line_char;
723723

724-
/* Windows only */
725-
enum hide_dotfiles_type {
726-
HIDE_DOTFILES_FALSE = 0,
727-
HIDE_DOTFILES_TRUE,
728-
HIDE_DOTFILES_DOTGITONLY
729-
};
730-
extern enum hide_dotfiles_type hide_dotfiles;
731-
732724
enum branch_track {
733725
BRANCH_TRACK_UNSPECIFIED = -1,
734726
BRANCH_TRACK_NEVER = 0,

compat/mingw.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,25 @@ static int ask_yes_no_if_possible(const char *format, ...)
202202
}
203203
}
204204

205+
/* Windows only */
206+
enum hide_dotfiles_type {
207+
HIDE_DOTFILES_FALSE = 0,
208+
HIDE_DOTFILES_TRUE,
209+
HIDE_DOTFILES_DOTGITONLY
210+
};
211+
212+
static enum hide_dotfiles_type hide_dotfiles = HIDE_DOTFILES_DOTGITONLY;
213+
205214
int mingw_core_config(const char *var, const char *value)
206215
{
216+
if (!strcmp(var, "core.hidedotfiles")) {
217+
if (value && !strcasecmp(value, "dotgitonly"))
218+
hide_dotfiles = HIDE_DOTFILES_DOTGITONLY;
219+
else
220+
hide_dotfiles = git_config_bool(var, value);
221+
return 0;
222+
}
223+
207224
return 0;
208225
}
209226

config.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -999,14 +999,6 @@ static int git_default_core_config(const char *var, const char *value)
999999
return 0;
10001000
}
10011001

1002-
if (!strcmp(var, "core.hidedotfiles")) {
1003-
if (value && !strcasecmp(value, "dotgitonly"))
1004-
hide_dotfiles = HIDE_DOTFILES_DOTGITONLY;
1005-
else
1006-
hide_dotfiles = git_config_bool(var, value);
1007-
return 0;
1008-
}
1009-
10101002
/* Add other config variables here and to Documentation/config.txt. */
10111003
return platform_core_config(var, value);
10121004
}

environment.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ int core_apply_sparse_checkout;
6363
int merge_log_config = -1;
6464
int precomposed_unicode = -1; /* see probe_utf8_pathname_composition() */
6565
unsigned long pack_size_limit_cfg;
66-
enum hide_dotfiles_type hide_dotfiles = HIDE_DOTFILES_DOTGITONLY;
6766

6867
#ifndef PROTECT_HFS_DEFAULT
6968
#define PROTECT_HFS_DEFAULT 0

0 commit comments

Comments
 (0)