Skip to content

Commit b0564bb

Browse files
author
Git for Windows Build Agent
committed
Merge branch 'clean-long-paths'
This addresses #521 Signed-off-by: Johannes Schindelin <[email protected]>
2 parents 968619c + 0ef9157 commit b0564bb

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

builtin/clean.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ static int remove_dirs(struct strbuf *path, const char *prefix, int force_flag,
192192
strbuf_setlen(path, len);
193193
strbuf_addstr(path, e->d_name);
194194
if (lstat(path->buf, &st))
195-
; /* fall thru */
195+
warning("Could not stat path '%s': %s",
196+
path->buf, strerror(errno));
196197
else if (S_ISDIR(st.st_mode)) {
197198
if (remove_dirs(path, prefix, force_flag, dry_run, quiet, &gone))
198199
ret = 1;

t/t7300-clean.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,4 +653,15 @@ test_expect_success 'git clean -d respects pathspecs (pathspec is prefix of dir)
653653
test_path_is_dir foobar
654654
'
655655

656+
test_expect_success MINGW 'handle clean & core.longpaths = false nicely' '
657+
git config core.longpaths false &&
658+
test_when_finished git config --unset core.longpaths &&
659+
a50=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &&
660+
mkdir -p $a50$a50/$a50$a50/$a50$a50 &&
661+
touch $a50$a50/test.txt &&
662+
touch $a50$a50/$a50$a50/$a50$a50/test.txt &&
663+
test_must_fail git clean -xdf 2>.git/err &&
664+
grep "too long" .git/err
665+
'
666+
656667
test_done

0 commit comments

Comments
 (0)