Skip to content

Commit 8d9a82c

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 78fd100 commit 8d9a82c

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

10461046
if (repo_read_index(the_repository) < 0)
10471047
die(_("index file corrupt"));
1048+
enable_fscache(the_index.cache_nr);
10481049

10491050
pl = add_pattern_list(&dir, EXC_CMDL, "--exclude option");
10501051
for (i = 0; i < exclude_list.nr; i++)
@@ -1119,6 +1120,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
11191120
}
11201121
}
11211122

1123+
disable_fscache();
11221124
strbuf_release(&abs_path);
11231125
strbuf_release(&buf);
11241126
string_list_clear(&del_list, 0);

0 commit comments

Comments
 (0)