Skip to content

Commit eb7ab8f

Browse files
committed
Merge branch 'clean-long-paths'
This addresses #521 Signed-off-by: Johannes Schindelin <[email protected]>
2 parents 04e3de4 + cb7266d commit eb7ab8f

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

builtin/clean.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ static int remove_dirs(struct strbuf *path, const char *prefix, int force_flag,
204204
strbuf_setlen(path, len);
205205
strbuf_addstr(path, e->d_name);
206206
if (lstat(path->buf, &st)) {
207-
; /* fall thru */
207+
warning("Could not stat path '%s': %s",
208+
path->buf, strerror(errno));
208209
} else if ((!prefix && skip_precious_file(&the_index, path->buf)) ||
209210
(prefix && skip_prefix(path->buf, prefix, &rel_path) &&
210211
skip_precious_file(&the_index, rel_path))) {

t/t7300-clean.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,4 +709,16 @@ test_expect_success 'git clean -xd still deletes them all' '
709709
test_path_is_missing precious/two.precious &&
710710
test_path_is_missing precious/sub/also.precious
711711
'
712+
713+
test_expect_success MINGW 'handle clean & core.longpaths = false nicely' '
714+
git config core.longpaths false &&
715+
test_when_finished git config --unset core.longpaths &&
716+
a50=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &&
717+
mkdir -p $a50$a50/$a50$a50/$a50$a50 &&
718+
touch $a50$a50/test.txt &&
719+
touch $a50$a50/$a50$a50/$a50$a50/test.txt &&
720+
test_must_fail git clean -xdf 2>.git/err &&
721+
grep "too long" .git/err
722+
'
723+
712724
test_done

0 commit comments

Comments
 (0)