Skip to content

Commit 7fc0b64

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 3329a58 commit 7fc0b64

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

10131013
if (read_cache() < 0)
10141014
die(_("index file corrupt"));
1015+
enable_fscache(active_nr);
10151016

10161017
pl = add_pattern_list(&dir, EXC_CMDL, "--exclude option");
10171018
for (i = 0; i < exclude_list.nr; i++)
@@ -1086,6 +1087,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
10861087
}
10871088
}
10881089

1090+
disable_fscache();
10891091
strbuf_release(&abs_path);
10901092
strbuf_release(&buf);
10911093
string_list_clear(&del_list, 0);

0 commit comments

Comments
 (0)