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 <[email protected]>
  • Loading branch information
dscho authored and Git for Windows Build Agent committed Aug 12, 2019
1 parent 0250555 commit a687606
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions builtin/clean.c
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)

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

if (!ignored)
setup_standard_excludes(&dir);
Expand Down Expand Up @@ -1073,6 +1074,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
strbuf_reset(&abs_path);
}

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

0 comments on commit a687606

Please sign in to comment.