diff --git a/compat/mingw.c b/compat/mingw.c index 4619ff15c7..fc1056b3bb 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -2889,6 +2889,15 @@ static void setup_windows_environment(void) if (!getenv("LC_ALL") && !getenv("LC_CTYPE") && !getenv("LANG")) setenv("LC_CTYPE", "C.UTF-8", 1); + + /* + * Change 'core.symlinks' default to false, unless native symlinks are + * enabled in MSys2 (via 'MSYS=winsymlinks:nativestrict'). Thus we can + * run the test suite (which doesn't obey config files) with or without + * symlink support. + */ + if (!(tmp = getenv("MSYS")) || !strstr(tmp, "winsymlinks:nativestrict")) + has_symlinks = 0; } int is_valid_win32_path(const char *path, int allow_literal_nul)