Skip to content

Commit bdfbb0e

Browse files
dschogitster
authored andcommitted
config: move Windows-specific config settings into compat/mingw.c
Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 70fc579 commit bdfbb0e

File tree

4 files changed

+18
-17
lines changed

4 files changed

+18
-17
lines changed

cache.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -906,14 +906,6 @@ int use_optional_locks(void);
906906
extern char comment_line_char;
907907
extern int auto_comment_line_char;
908908

909-
/* Windows only */
910-
enum hide_dotfiles_type {
911-
HIDE_DOTFILES_FALSE = 0,
912-
HIDE_DOTFILES_TRUE,
913-
HIDE_DOTFILES_DOTGITONLY
914-
};
915-
extern enum hide_dotfiles_type hide_dotfiles;
916-
917909
enum log_refs_config {
918910
LOG_REFS_UNSET = -1,
919911
LOG_REFS_NONE = 0,

compat/mingw.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "../run-command.h"
77
#include "../cache.h"
88
#include "win32/lazyload.h"
9+
#include "../config.h"
910

1011
#define HCAST(type, handle) ((type)(intptr_t)handle)
1112

@@ -203,8 +204,25 @@ static int ask_yes_no_if_possible(const char *format, ...)
203204
}
204205
}
205206

207+
/* Windows only */
208+
enum hide_dotfiles_type {
209+
HIDE_DOTFILES_FALSE = 0,
210+
HIDE_DOTFILES_TRUE,
211+
HIDE_DOTFILES_DOTGITONLY
212+
};
213+
214+
static enum hide_dotfiles_type hide_dotfiles = HIDE_DOTFILES_DOTGITONLY;
215+
206216
int mingw_core_config(const char *var, const char *value, void *cb)
207217
{
218+
if (!strcmp(var, "core.hidedotfiles")) {
219+
if (value && !strcasecmp(value, "dotgitonly"))
220+
hide_dotfiles = HIDE_DOTFILES_DOTGITONLY;
221+
else
222+
hide_dotfiles = git_config_bool(var, value);
223+
return 0;
224+
}
225+
208226
return 0;
209227
}
210228

config.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,14 +1344,6 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
13441344
return 0;
13451345
}
13461346

1347-
if (!strcmp(var, "core.hidedotfiles")) {
1348-
if (value && !strcasecmp(value, "dotgitonly"))
1349-
hide_dotfiles = HIDE_DOTFILES_DOTGITONLY;
1350-
else
1351-
hide_dotfiles = git_config_bool(var, value);
1352-
return 0;
1353-
}
1354-
13551347
if (!strcmp(var, "core.partialclonefilter")) {
13561348
return git_config_string(&core_partial_clone_filter_default,
13571349
var, value);

environment.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ int core_apply_sparse_checkout;
7171
int merge_log_config = -1;
7272
int precomposed_unicode = -1; /* see probe_utf8_pathname_composition() */
7373
unsigned long pack_size_limit_cfg;
74-
enum hide_dotfiles_type hide_dotfiles = HIDE_DOTFILES_DOTGITONLY;
7574
enum log_refs_config log_all_ref_updates = LOG_REFS_UNSET;
7675

7776
#ifndef PROTECT_HFS_DEFAULT

0 commit comments

Comments
 (0)