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 committed Jan 11, 2025
1 parent 014d3fe commit bc90e75
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 @@ -1043,6 +1043,7 @@ int cmd_clean(int argc,

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 @@ -1117,6 +1118,7 @@ int cmd_clean(int argc,
}
}

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

0 comments on commit bc90e75

Please sign in to comment.