X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-clean.c;h=fac64e6cd3717dfffb0f54124de9545f7cdc391a;hb=92de348948d59f797dd4f15d6a4558c0563203b1;hp=28cdcd0274dd5891c7ad3dc3804cb0acead883f2;hpb=7ad9cec81d86ccf7a693ad7e1218e238aee5ca9d;p=git.git diff --git a/builtin-clean.c b/builtin-clean.c index 28cdcd027..fac64e6cd 100644 --- a/builtin-clean.c +++ b/builtin-clean.c @@ -67,19 +67,21 @@ int cmd_clean(int argc, const char **argv, const char *prefix) die("-x and -X cannot be used together"); if (!show_only && !force) - die("clean.requireForce%s set and -n or -f not given; " - "refusing to clean", config_set ? "" : " not"); + die("clean.requireForce %s to true and neither -n nor -f given; " + "refusing to clean", config_set ? "set" : "defaults"); if (force > 1) rm_flags = 0; dir.flags |= DIR_SHOW_OTHER_DIRECTORIES; + if (read_cache() < 0) + die("index file corrupt"); + if (!ignored) setup_standard_excludes(&dir); pathspec = get_pathspec(prefix, argv); - read_cache(); fill_directory(&dir, pathspec);