]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/clean.c
clean: show an error message when the path is too long
[thirdparty/git.git] / builtin / clean.c
index aaba4af3c26de2150ad655a0b162fc85a69a466d..d5579da716e06f372132f827852b0f49f1e4af1d 100644 (file)
@@ -34,6 +34,7 @@ static const char *msg_would_remove = N_("Would remove %s\n");
 static const char *msg_skip_git_dir = N_("Skipping repository %s\n");
 static const char *msg_would_skip_git_dir = N_("Would skip repository %s\n");
 static const char *msg_warn_remove_failed = N_("failed to remove %s");
+static const char *msg_warn_lstat_failed = N_("could not lstat %s\n");
 
 enum color_clean {
        CLEAN_COLOR_RESET = 0,
@@ -194,7 +195,7 @@ 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_errno(_(msg_warn_lstat_failed), path->buf);
                else if (S_ISDIR(st.st_mode)) {
                        if (remove_dirs(path, prefix, force_flag, dry_run, quiet, &gone))
                                ret = 1;