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 24, 2024
1 parent 0275f96 commit cbc3820
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 @@ -1038,6 +1038,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)

if (repo_read_index(the_repository) < 0)
die(_("index file corrupt"));
enable_fscache(the_repository->index->cache_nr);

pl = add_pattern_list(&dir, EXC_CMDL, "--exclude option");
for (i = 0; i < exclude_list.nr; i++)
Expand Down Expand Up @@ -1112,6 +1113,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 cbc3820

Please sign in to comment.