Skip to content

Commit 32a5c72

Browse files
committed
Merge branch 'move-gfw-system-config-to-top-level'
Make `git config --system` work like you think it should on Windows: it should edit the file that is located in `<Git>\etc\gitconfig`. Signed-off-by: Johannes Schindelin <[email protected]>
2 parents 0dbb47b + 1555f9c commit 32a5c72

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

config.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1657,9 +1657,11 @@ static int git_config_from_blob_ref(config_fn_t fn,
16571657

16581658
const char *git_etc_gitconfig(void)
16591659
{
1660-
static const char *system_wide;
1661-
if (!system_wide)
1660+
static char *system_wide;
1661+
if (!system_wide) {
16621662
system_wide = system_path(ETC_GITCONFIG);
1663+
normalize_path_copy(system_wide, system_wide);
1664+
}
16631665
return system_wide;
16641666
}
16651667

config.mak.uname

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,11 @@ ifeq ($(uname_S),Windows)
424424
NO_POSIX_GOODIES = UnfortunatelyYes
425425
NATIVE_CRLF = YesPlease
426426
DEFAULT_HELP_FORMAT = html
427+
ifeq (/mingw64,$(subst 32,64,$(prefix)))
428+
# Move system config into top-level /etc/
429+
ETC_GITCONFIG = ../etc/gitconfig
430+
ETC_GITATTRIBUTES = ../etc/gitattributes
431+
endif
427432

428433
CC = compat/vcbuild/scripts/clink.pl
429434
AR = compat/vcbuild/scripts/lib.pl
@@ -669,6 +674,11 @@ else
669674
USE_LIBPCRE = YesPlease
670675
NO_CURL =
671676
USE_NED_ALLOCATOR = YesPlease
677+
ifeq (/mingw64,$(subst 32,64,$(prefix)))
678+
# Move system config into top-level /etc/
679+
ETC_GITCONFIG = ../etc/gitconfig
680+
ETC_GITATTRIBUTES = ../etc/gitattributes
681+
endif
672682
else
673683
COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO
674684
NO_CURL = YesPlease

0 commit comments

Comments
 (0)