Skip to content

Commit a513ad8

Browse files
dschoGit for Windows Build Agent
authored and
Git for Windows Build Agent
committed
t7300: git clean -dfx must show an error with long paths
In particular on Windows, where the default maximum path length is quite small, but 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' issue 521: #521 Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 8394a67 commit a513ad8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

t/t7300-clean.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,4 +669,15 @@ test_expect_success 'git clean -d skips untracked dirs containing ignored files'
669669
test_path_is_missing foo/b/bb
670670
'
671671

672+
test_expect_success MINGW 'handle clean & core.longpaths = false nicely' '
673+
git config core.longpaths false &&
674+
test_when_finished git config --unset core.longpaths &&
675+
a50=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &&
676+
mkdir -p $a50$a50/$a50$a50/$a50$a50 &&
677+
touch $a50$a50/test.txt &&
678+
touch $a50$a50/$a50$a50/$a50$a50/test.txt &&
679+
test_must_fail git clean -xdf 2>.git/err &&
680+
grep "too long" .git/err
681+
'
682+
672683
test_done

0 commit comments

Comments
 (0)