Skip to content

Commit 83b08eb

Browse files
pks-tdscho
authored andcommitted
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 106834e (t7300: work around platform-specific behaviour with long paths on MinGW, 2024-10-09).] Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 7e6073d commit 83b08eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/t7300-clean.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ test_expect_success MINGW 'handle clean & core.longpaths = false nicely' '
735735
test_must_fail git clean -xdf 2>.git/err &&
736736
# grepping for a strerror string is unportable but it is OK here with
737737
# MINGW prereq
738-
test_i18ngrep "too long" .git/err
738+
test_i18ngrep -e "too long" -e "No such file or directory" .git/err
739739
'
740740

741741
test_expect_success 'clean untracked paths by pathspec' '

0 commit comments

Comments
 (0)