Skip to content

Commit feff761

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 1694e02 commit feff761

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
@@ -1040,6 +1040,7 @@ int cmd_clean(int argc,
10401040

10411041
if (repo_read_index(the_repository) < 0)
10421042
die(_("index file corrupt"));
1043+
enable_fscache(the_repository->index->cache_nr);
10431044

10441045
pl = add_pattern_list(&dir, EXC_CMDL, "--exclude option");
10451046
for (i = 0; i < exclude_list.nr; i++)
@@ -1114,6 +1115,7 @@ int cmd_clean(int argc,
11141115
}
11151116
}
11161117

1118+
disable_fscache();
11171119
strbuf_release(&abs_path);
11181120
strbuf_release(&buf);
11191121
string_list_clear(&del_list, 0);

0 commit comments

Comments
 (0)