Skip to content

Commit b7ca314

Browse files
dschodrizzd
authored andcommitted
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 <[email protected]>
1 parent a182516 commit b7ca314

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

builtin/clean.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
984984

985985
if (read_cache() < 0)
986986
die(_("index file corrupt"));
987+
enable_fscache(active_nr);
987988

988989
if (!ignored)
989990
setup_standard_excludes(&dir);
@@ -1073,6 +1074,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
10731074
strbuf_reset(&abs_path);
10741075
}
10751076

1077+
disable_fscache();
10761078
strbuf_release(&abs_path);
10771079
strbuf_release(&buf);
10781080
string_list_clear(&del_list, 0);

0 commit comments

Comments
 (0)