mirror of
https://github.com/git/git.git
synced 2026-01-18 14:44:28 +00:00
Merge branch 'clean-long-paths'
This addresses https://github.com/git-for-windows/git/issues/521 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
@@ -193,7 +193,8 @@ static int remove_dirs(struct strbuf *path, const char *prefix, int force_flag,
|
||||
strbuf_setlen(path, len);
|
||||
strbuf_addstr(path, e->d_name);
|
||||
if (lstat(path->buf, &st))
|
||||
; /* fall thru */
|
||||
warning("Could not stat path '%s': %s",
|
||||
path->buf, strerror(errno));
|
||||
else if (S_ISDIR(st.st_mode)) {
|
||||
if (remove_dirs(path, prefix, force_flag, dry_run, quiet, &gone))
|
||||
ret = 1;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user