Skip to content

Commit 13dc32a

Browse files
dschoGit for Windows Build Agent
authored and
Git for Windows Build Agent
committed
remove_dirs: do not swallow error when stat() failed
Without an error message when stat() failed, e.g. `git clean` would abort without an error message, leaving the user quite puzzled. This fixes #521 Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 3795744 commit 13dc32a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

builtin/clean.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,8 @@ static int remove_dirs(struct strbuf *path, const char *prefix, int force_flag,
194194
strbuf_setlen(path, len);
195195
strbuf_addstr(path, e->d_name);
196196
if (lstat(path->buf, &st))
197-
; /* fall thru */
197+
warning("Could not stat path '%s': %s",
198+
path->buf, strerror(errno));
198199
else if (S_ISDIR(st.st_mode)) {
199200
if (remove_dirs(path, prefix, force_flag, dry_run, quiet, &gone))
200201
ret = 1;

0 commit comments

Comments
 (0)