summaryrefslogtreecommitdiff
path: root/builtin-clean.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin-clean.c')
-rw-r--r--builtin-clean.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/builtin-clean.c b/builtin-clean.c
index 28cdcd0..fac64e6 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);