clean: show an error message when the path is too long
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Thu, 18 Jul 2019 09:30:33 +0000 (02:30 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 19 Jul 2019 15:12:44 +0000 (08:12 -0700)
commitb09364c47a015dee7735fd2c038d7d710417c2f2
tree87a34fe23b44f7645f3274bb73c54a5f049c394b
parentb697d92f56511e804b8ba20ccbe7bdc85dc66810
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 this issue:

https://github.com/git-for-windows/git/issues/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.

Helped-by: René Scharfe <l.s.r@web.de>
Helped-by: SZEDER Gábor <szeder.dev@gmail.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/clean.c
t/t7300-clean.sh