Skip to content

Commit 4465a39

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

File tree

5 files changed

+33
-33
lines changed

5 files changed

+33
-33
lines changed

cache.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -721,18 +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-
732-
extern int core_fscache;
733-
734-
extern int core_long_paths;
735-
736724
enum branch_track {
737725
BRANCH_TRACK_UNSPECIFIED = -1,
738726
BRANCH_TRACK_NEVER = 0,

compat/mingw.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,37 @@ static int retry_ask_yes_no(int *tries, const char *format, ...)
228228
return result;
229229
}
230230

231+
/* Windows only */
232+
enum hide_dotfiles_type {
233+
HIDE_DOTFILES_FALSE = 0,
234+
HIDE_DOTFILES_TRUE,
235+
HIDE_DOTFILES_DOTGITONLY
236+
};
237+
238+
static enum hide_dotfiles_type hide_dotfiles = HIDE_DOTFILES_DOTGITONLY;
239+
int core_fscache;
240+
int core_long_paths;
241+
231242
int mingw_core_config(const char *var, const char *value)
232243
{
244+
if (!strcmp(var, "core.hidedotfiles")) {
245+
if (value && !strcasecmp(value, "dotgitonly"))
246+
hide_dotfiles = HIDE_DOTFILES_DOTGITONLY;
247+
else
248+
hide_dotfiles = git_config_bool(var, value);
249+
return 0;
250+
}
251+
252+
if (!strcmp(var, "core.fscache")) {
253+
core_fscache = git_config_bool(var, value);
254+
return 0;
255+
}
256+
257+
if (!strcmp(var, "core.longpaths")) {
258+
core_long_paths = git_config_bool(var, value);
259+
return 0;
260+
}
261+
233262
return 0;
234263
}
235264

compat/mingw.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ typedef _sigset_t sigset_t;
1111
#undef _POSIX_THREAD_SAFE_FUNCTIONS
1212
#endif
1313

14+
extern int core_fscache;
15+
16+
extern int core_long_paths;
17+
1418
extern int mingw_core_config(const char *var, const char *value);
1519
#define platform_core_config mingw_core_config
1620

config.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -999,24 +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-
1010-
if (!strcmp(var, "core.fscache")) {
1011-
core_fscache = git_config_bool(var, value);
1012-
return 0;
1013-
}
1014-
1015-
if (!strcmp(var, "core.longpaths")) {
1016-
core_long_paths = git_config_bool(var, value);
1017-
return 0;
1018-
}
1019-
10201002
/* Add other config variables here and to Documentation/config.txt. */
10211003
return platform_core_config(var, value);
10221004
}

environment.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +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;
67-
int core_fscache;
68-
int core_long_paths;
6966

7067
#ifndef PROTECT_HFS_DEFAULT
7168
#define PROTECT_HFS_DEFAULT 0

0 commit comments

Comments
 (0)