Skip to content

Commit 903f43b

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 2996d7f commit 903f43b

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

10501050
if (repo_read_index(the_repository) < 0)
10511051
die(_("index file corrupt"));
1052+
enable_fscache(the_index.cache_nr);
10521053

10531054
pl = add_pattern_list(&dir, EXC_CMDL, "--exclude option");
10541055
for (i = 0; i < exclude_list.nr; i++)
@@ -1123,6 +1124,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
11231124
}
11241125
}
11251126

1127+
disable_fscache();
11261128
strbuf_release(&abs_path);
11271129
strbuf_release(&buf);
11281130
string_list_clear(&del_list, 0);

0 commit comments

Comments
 (0)