Skip to content

Commit

Permalink
t7300: git clean -dfx must show an error with long paths
Browse files Browse the repository at this point in the history
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 <johannes.schindelin@gmx.de>
  • Loading branch information
dscho authored and Git for Windows Build Agent committed Jul 23, 2019
1 parent 13dc32a commit 007945c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions t/t7300-clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -669,4 +669,15 @@ test_expect_success 'git clean -d skips untracked dirs containing ignored files'
test_path_is_missing foo/b/bb
'

test_expect_success MINGW 'handle clean & core.longpaths = false nicely' '
git config core.longpaths false &&
test_when_finished git config --unset core.longpaths &&
a50=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &&
mkdir -p $a50$a50/$a50$a50/$a50$a50 &&
touch $a50$a50/test.txt &&
touch $a50$a50/$a50$a50/$a50$a50/test.txt &&
test_must_fail git clean -xdf 2>.git/err &&
grep "too long" .git/err
'

test_done

0 comments on commit 007945c

Please sign in to comment.