summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-10-09 15:25:18 +0200
committerJohannes Schindelin <johannes.schindelin@gmx.de>2024-10-30 17:38:35 +0100
commit83b08eb19f05710a92d565124606dcaf68bcc68b (patch)
tree9455e55d98f5fb3a68e46571a58d055956881617
parentcompat/regex: fix argument order to calloc(3) (diff)
downloadgit-83b08eb19f05710a92d565124606dcaf68bcc68b.tar.xz
git-83b08eb19f05710a92d565124606dcaf68bcc68b.zip
t7300: work around platform-specific behaviour with long paths on MinGW
Windows by default has a restriction in place to only allow paths up to 260 characters. This restriction can nowadays be lifted by setting a registry key, but is still active by default. In t7300 we have one test that exercises the behaviour of git-clean(1) with such long paths. Interestingly enough, this test fails on my system that uses Windows 10 with mingw-w64 installed via MSYS2: instead of observing ENAMETOOLONG, we observe ENOENT. This behaviour is consistent across multiple different environments I have tried. I cannot say why exactly we observe a different error here, but I would not be surprised if this was either dependent on the Windows version, the version of MinGW, the current working directory of Git or any kind of combination of these. Work around the issue by handling both errors. [Backported from 106834e34a2 (t7300: work around platform-specific behaviour with long paths on MinGW, 2024-10-09).] Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
-rwxr-xr-xt/t7300-clean.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh
index c975eb54d2..a831438f74 100755
--- a/t/t7300-clean.sh
+++ b/t/t7300-clean.sh
@@ -735,7 +735,7 @@ test_expect_success MINGW 'handle clean & core.longpaths = false nicely' '
test_must_fail git clean -xdf 2>.git/err &&
# grepping for a strerror string is unportable but it is OK here with
# MINGW prereq
- test_i18ngrep "too long" .git/err
+ test_i18ngrep -e "too long" -e "No such file or directory" .git/err
'
test_expect_success 'clean untracked paths by pathspec' '