Skip to content

Commit

Permalink
Merge pull request #971 from jeffhostetler/jeffhostetler/add_preload_…
Browse files Browse the repository at this point in the history
…fscache

add: use preload-index and fscache for performance
  • Loading branch information
dscho authored and Git for Windows Build Agent committed Oct 10, 2024
2 parents ba97e86 + e94cfc5 commit b02dba1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions builtin/add.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,10 @@ int cmd_add(int argc,
die_in_unpopulated_submodule(repo->index, prefix);
die_path_inside_submodule(repo->index, &pathspec);

enable_fscache(1);
/* We do not really re-read the index but update the up-to-date flags */
preload_index(repo->index, &pathspec, 0);

if (add_new_files) {
int baselen;

Expand Down Expand Up @@ -588,5 +592,6 @@ int cmd_add(int argc,
free(ps_matched);
dir_clear(&dir);
clear_pathspec(&pathspec);
enable_fscache(0);
return exit_status;
}

0 comments on commit b02dba1

Please sign in to comment.