Skip to content

Commit 1b35342

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 27e3e78 commit 1b35342

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
@@ -193,7 +193,8 @@ static int remove_dirs(struct strbuf *path, const char *prefix, int force_flag,
193193
strbuf_setlen(path, len);
194194
strbuf_addstr(path, e->d_name);
195195
if (lstat(path->buf, &st))
196-
; /* fall thru */
196+
warning("Could not stat path '%s': %s",
197+
path->buf, strerror(errno));
197198
else if (S_ISDIR(st.st_mode)) {
198199
if (remove_dirs(path, prefix, force_flag, dry_run, quiet, &gone))
199200
ret = 1;

0 commit comments

Comments
 (0)