From fa0e60a02ff38f48d7fac998b04fe776d74206dd Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 11 Dec 2018 12:17:49 +0100 Subject: [PATCH] clean: make use of FSCache The `git clean` command needs to enumerate plenty of files and directories, and can therefore benefit from the FSCache. Signed-off-by: Johannes Schindelin --- builtin/clean.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/builtin/clean.c b/builtin/clean.c index d9df39f0cc..b282bb4b2b 100644 --- a/builtin/clean.c +++ b/builtin/clean.c @@ -1049,6 +1049,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix) if (repo_read_index(the_repository) < 0) die(_("index file corrupt")); + enable_fscache(the_index.cache_nr); pl = add_pattern_list(&dir, EXC_CMDL, "--exclude option"); for (i = 0; i < exclude_list.nr; i++) @@ -1123,6 +1124,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix) } } + disable_fscache(); strbuf_release(&abs_path); strbuf_release(&buf); string_list_clear(&del_list, 0);