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 <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2019-10-18 09:06:18 +02:00
2 changed files with 14 additions and 2 deletions

View File

@@ -1662,9 +1662,11 @@ static int git_config_from_blob_ref(config_fn_t fn,
const char *git_etc_gitconfig(void)
{
static const char *system_wide;
if (!system_wide)
static char *system_wide;
if (!system_wide) {
system_wide = system_path(ETC_GITCONFIG);
normalize_path_copy(system_wide, system_wide);
}
return system_wide;
}

View File

@@ -424,6 +424,11 @@ ifeq ($(uname_S),Windows)
NO_POSIX_GOODIES = UnfortunatelyYes
NATIVE_CRLF = YesPlease
DEFAULT_HELP_FORMAT = html
ifeq (/mingw64,$(subst 32,64,$(prefix)))
# Move system config into top-level /etc/
ETC_GITCONFIG = ../etc/gitconfig
ETC_GITATTRIBUTES = ../etc/gitattributes
endif
CC = compat/vcbuild/scripts/clink.pl
AR = compat/vcbuild/scripts/lib.pl
@@ -668,6 +673,11 @@ else
USE_LIBPCRE = YesPlease
NO_CURL =
USE_NED_ALLOCATOR = YesPlease
ifeq (/mingw64,$(subst 32,64,$(prefix)))
# Move system config into top-level /etc/
ETC_GITCONFIG = ../etc/gitconfig
ETC_GITATTRIBUTES = ../etc/gitattributes
endif
else
COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO
NO_CURL = YesPlease