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 22, 2024
2 parents 55623db + 70297f9 commit c31d379
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 @@ -475,6 +475,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 @@ -587,5 +591,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 c31d379

Please sign in to comment.