ie_match_stat(): do not ignore skip-worktree bit with CE_MATCH_IGNORE_VALID
[gitweb.git] / builtin-clean.c
index 2d8c735d4881a005e4aa5006d9781b71631bb0af..e424b77e6b7367a5704d586ab38d34908684de55 100644 (file)
@@ -71,11 +71,13 @@ 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");
+
        if (!ignored)
                setup_standard_excludes(&dir);
 
        pathspec = get_pathspec(prefix, argv);
-       read_cache();
 
        fill_directory(&dir, pathspec);