Skip to content

Commit 2c8d5b9

Browse files
dschoGit for Windows Build Agent
authored andcommitted
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 6a24c5a commit 2c8d5b9

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

10431043
if (repo_read_index(the_repository) < 0)
10441044
die(_("index file corrupt"));
1045+
enable_fscache(the_repository->index->cache_nr);
10451046

10461047
pl = add_pattern_list(&dir, EXC_CMDL, "--exclude option");
10471048
for (i = 0; i < exclude_list.nr; i++)
@@ -1116,6 +1117,7 @@ int cmd_clean(int argc,
11161117
}
11171118
}
11181119

1120+
disable_fscache();
11191121
strbuf_release(&abs_path);
11201122
strbuf_release(&buf);
11211123
string_list_clear(&del_list, 0);

0 commit comments

Comments
 (0)