Skip to content

Commit

Permalink
Merge branch 'clean-long-paths'
Browse files Browse the repository at this point in the history
This addresses #521

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Mar 14, 2016
2 parents d045e30 + bd0ecb6 commit 70c3647
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion builtin/clean.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,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;
Expand Down
11 changes: 11 additions & 0 deletions t/t7300-clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -653,4 +653,15 @@ test_expect_success 'git clean -d respects pathspecs (pathspec is prefix of dir)
test_path_is_dir foobar
'

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 70c3647

Please sign in to comment.