From f09e26dd67e13a2581189a6ff4b7752e10c40571 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 16 Feb 2016 16:31:12 +0100 Subject: [PATCH] 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 --- builtin/clean.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builtin/clean.c b/builtin/clean.c index fb1824ce951b62..e249f330c3edb0 100644 --- a/builtin/clean.c +++ b/builtin/clean.c @@ -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;