Skip to content

Commit 7d7c8d2

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 87a73ce commit 7d7c8d2

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

10391039
if (repo_read_index(the_repository) < 0)
10401040
die(_("index file corrupt"));
1041+
enable_fscache(the_repository->index->cache_nr);
10411042

10421043
pl = add_pattern_list(&dir, EXC_CMDL, "--exclude option");
10431044
for (i = 0; i < exclude_list.nr; i++)
@@ -1112,6 +1113,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
11121113
}
11131114
}
11141115

1116+
disable_fscache();
11151117
strbuf_release(&abs_path);
11161118
strbuf_release(&buf);
11171119
string_list_clear(&del_list, 0);

0 commit comments

Comments
 (0)