mirror of
https://github.com/git/git.git
synced 2026-01-17 14:21:57 +00:00
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 https://github.com/git-for-windows/git/issues/521 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user