diff --git a/compat/mingw.c b/compat/mingw.c index 0615f182f0..f72120634a 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -505,9 +505,8 @@ static int current_directory_len = 0; int mingw_chdir(const char *dirname) { int result; - wchar_t wdirname[MAX_PATH]; - /* SetCurrentDirectoryW doesn't support long paths */ - if (xutftowcs_path(wdirname, dirname) < 0) + wchar_t wdirname[MAX_LONG_PATH]; + if (xutftowcs_long_path(wdirname, dirname) < 0) return -1; result = _wchdir(wdirname); current_directory_len = GetCurrentDirectoryW(0, NULL); diff --git a/t/t2027-checkout-long-paths.sh b/t/t2028-checkout-long-paths.sh similarity index 98% rename from t/t2027-checkout-long-paths.sh rename to t/t2028-checkout-long-paths.sh index e65a38da4d..79345ed7fd 100755 --- a/t/t2027-checkout-long-paths.sh +++ b/t/t2028-checkout-long-paths.sh @@ -52,7 +52,10 @@ test_expect_success 'update of long paths' ' test_expect_success cleanup ' # bash cannot delete the trash dir if it contains a long path # lets help cleaning up (unless in debug mode) - test ! -z "$debug" || rm -rf longpa~1 + if test -z "$debug" + then + rm -rf longpa~1 + fi ' # check that the template used in the test won't be too long: