X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin%2Fclean.c;h=75697f711116e42df1e21e608c21829f49549b08;hb=d9ac3e41c37ea565d8227d942b4f468616c9813a;hp=4a312abc6b3ecef5f174b2786ad31385ba058b44;hpb=4b28cd9f2fb755cdfe1b97130e84644ae932988c;p=git.git diff --git a/builtin/clean.c b/builtin/clean.c index 4a312abc6..75697f711 100644 --- a/builtin/clean.c +++ b/builtin/clean.c @@ -75,11 +75,16 @@ int cmd_clean(int argc, const char **argv, const char *prefix) dir.flags |= DIR_SHOW_IGNORED; if (ignored && ignored_only) - die("-x and -X cannot be used together"); - - if (!show_only && !force) - die("clean.requireForce %s to true and neither -n nor -f given; " - "refusing to clean", config_set ? "set" : "defaults"); + die(_("-x and -X cannot be used together")); + + if (!show_only && !force) { + if (config_set) + die(_("clean.requireForce set to true and neither -n nor -f given; " + "refusing to clean")); + else + die(_("clean.requireForce defaults to true and neither -n nor -f given; " + "refusing to clean")); + } if (force > 1) rm_flags = 0; @@ -87,7 +92,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix) dir.flags |= DIR_SHOW_OTHER_DIRECTORIES; if (read_cache() < 0) - die("index file corrupt"); + die(_("index file corrupt")); if (!ignored) setup_standard_excludes(&dir); @@ -146,20 +151,20 @@ int cmd_clean(int argc, const char **argv, const char *prefix) qname = quote_path_relative(directory.buf, directory.len, &buf, prefix); if (show_only && (remove_directories || (matches == MATCHED_EXACTLY))) { - printf("Would remove %s\n", qname); + printf(_("Would remove %s\n"), qname); } else if (remove_directories || (matches == MATCHED_EXACTLY)) { if (!quiet) - printf("Removing %s\n", qname); + printf(_("Removing %s\n"), qname); if (remove_dir_recursively(&directory, rm_flags) != 0) { - warning("failed to remove %s", qname); + warning(_("failed to remove %s"), qname); errors++; } } else if (show_only) { - printf("Would not remove %s\n", qname); + printf(_("Would not remove %s\n"), qname); } else { - printf("Not removing %s\n", qname); + printf(_("Not removing %s\n"), qname); } strbuf_reset(&directory); } else { @@ -167,13 +172,13 @@ int cmd_clean(int argc, const char **argv, const char *prefix) continue; qname = quote_path_relative(ent->name, -1, &buf, prefix); if (show_only) { - printf("Would remove %s\n", qname); + printf(_("Would remove %s\n"), qname); continue; } else if (!quiet) { - printf("Removing %s\n", qname); + printf(_("Removing %s\n"), qname); } if (unlink(ent->name) != 0) { - warning("failed to remove %s", qname); + warning(_("failed to remove %s"), qname); errors++; } }