Note that, on Widows, even a git clean -xdf
might fail, silently skipping a path when it cannot lstat()
it; now (Git 2.23, Q3 2019), it gives a warning.
See commit b09364c (18 Jul 2019) by Johannes Schindelin (dscho
).
Helped-by: René Scharfe (rscharfe
), SZEDER Gábor (szeder
), and Junio C Hamano (gitster
).
(Merged by Junio C Hamano -- gitster
-- in commit f3d508f, 25 Jul 2019)
clean
: show an error message when the path is too long
When lstat()
failed, git clean
would abort without an error message, leaving the user quite puzzled.
In particular on Windows, where the default maximum path length is quite small (yet there are ways to circumvent that limit in many cases), it is very important that users be given an indication why their command failed because of too long paths when it did.
This test case makes sure that a warning is issued that would have helped the user who reported git-for-windows/git
issue 521
Note that we temporarily set core.longpaths = false
in the regression test; this ensures forward-compatibility with the core.longpaths
feature that has not yet been upstreamed from Git for Windows.