Skip to content

Commit 997e94e

Browse files
dschoderrickstolee
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 75ec1b6 commit 997e94e

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
@@ -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++)
@@ -1096,6 +1097,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
10961097
}
10971098
}
10981099

1100+
disable_fscache();
10991101
strbuf_release(&abs_path);
11001102
strbuf_release(&buf);
11011103
string_list_clear(&del_list, 0);

0 commit comments

Comments
 (0)