Skip to content

Commit 5bc0864

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 defc57f commit 5bc0864

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
@@ -1041,6 +1041,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
10411041

10421042
if (repo_read_index(the_repository) < 0)
10431043
die(_("index file corrupt"));
1044+
enable_fscache(the_index.cache_nr);
10441045

10451046
pl = add_pattern_list(&dir, EXC_CMDL, "--exclude option");
10461047
for (i = 0; i < exclude_list.nr; i++)
@@ -1115,6 +1116,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
11151116
}
11161117
}
11171118

1119+
disable_fscache();
11181120
strbuf_release(&abs_path);
11191121
strbuf_release(&buf);
11201122
string_list_clear(&del_list, 0);

0 commit comments

Comments
 (0)