diff --git a/compat/mingw.c b/compat/mingw.c index 654bf144eb..46a36df53a 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -2332,6 +2332,15 @@ static void setup_windows_environment(void) if (!tmp && (tmp = getenv("USERPROFILE"))) setenv("HOME", tmp, 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 handle_long_path(wchar_t *path, int len, int max_path, int expand)