Skip to content

Commit ea4fb26

Browse files
dschoGit for Windows Build Agent
authored andcommitted
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 78c58c1 + 7645124 commit ea4fb26

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
@@ -1678,9 +1678,11 @@ static int git_config_from_blob_ref(config_fn_t fn,
16781678

16791679
const char *git_etc_gitconfig(void)
16801680
{
1681-
static const char *system_wide;
1682-
if (!system_wide)
1681+
static char *system_wide;
1682+
if (!system_wide) {
16831683
system_wide = system_path(ETC_GITCONFIG);
1684+
normalize_path_copy(system_wide, system_wide);
1685+
}
16841686
return system_wide;
16851687
}
16861688

config.mak.uname

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,11 @@ ifeq ($(uname_S),Windows)
433433
NO_POSIX_GOODIES = UnfortunatelyYes
434434
NATIVE_CRLF = YesPlease
435435
DEFAULT_HELP_FORMAT = html
436+
ifeq (/mingw64,$(subst 32,64,$(prefix)))
437+
# Move system config into top-level /etc/
438+
ETC_GITCONFIG = ../etc/gitconfig
439+
ETC_GITATTRIBUTES = ../etc/gitattributes
440+
endif
436441

437442
CC = compat/vcbuild/scripts/clink.pl
438443
AR = compat/vcbuild/scripts/lib.pl
@@ -677,6 +682,11 @@ else
677682
USE_LIBPCRE = YesPlease
678683
NO_CURL =
679684
USE_NED_ALLOCATOR = YesPlease
685+
ifeq (/mingw64,$(subst 32,64,$(prefix)))
686+
# Move system config into top-level /etc/
687+
ETC_GITCONFIG = ../etc/gitconfig
688+
ETC_GITATTRIBUTES = ../etc/gitattributes
689+
endif
680690
else
681691
COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO
682692
NO_CURL = YesPlease

0 commit comments

Comments
 (0)