Skip to content

Commit 342f360

Browse files
committed
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 691ec68 commit 342f360

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

builtin/clean.c

+2
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
10161016

10171017
if (read_cache() < 0)
10181018
die(_("index file corrupt"));
1019+
enable_fscache(active_nr);
10191020

10201021
pl = add_pattern_list(&dir, EXC_CMDL, "--exclude option");
10211022
for (i = 0; i < exclude_list.nr; i++)
@@ -1092,6 +1093,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
10921093
}
10931094
}
10941095

1096+
disable_fscache();
10951097
strbuf_release(&abs_path);
10961098
strbuf_release(&buf);
10971099
string_list_clear(&del_list, 0);

0 commit comments

Comments
 (0)