Skip to content

Commit ed95bb6

Browse files
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 bed6711 commit ed95bb6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-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))) {

0 commit comments

Comments
 (0)