Skip to content

Commit

Permalink
clean: make use of FSCache
Browse files Browse the repository at this point in the history
The `git clean` command needs to enumerate plenty of files and
directories, and can therefore benefit from the FSCache.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Sep 22, 2022
1 parent c4f9797 commit be9795a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions builtin/clean.c
Expand Up @@ -1041,6 +1041,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)

if (read_cache() < 0)
die(_("index file corrupt"));
enable_fscache(active_nr);

pl = add_pattern_list(&dir, EXC_CMDL, "--exclude option");
for (i = 0; i < exclude_list.nr; i++)
Expand Down Expand Up @@ -1115,6 +1116,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
}
}

disable_fscache();
strbuf_release(&abs_path);
strbuf_release(&buf);
string_list_clear(&del_list, 0);
Expand Down

0 comments on commit be9795a

Please sign in to comment.