Skip to content

Commit e6c771d

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 e5ae629 commit e6c771d

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
@@ -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;

0 commit comments

Comments
 (0)