Skip to content

Commit cc0d2da

Browse files
committed
Merge pull request #971 from jeffhostetler/jeffhostetler/add_preload_fscache
add: use preload-index and fscache for performance
2 parents e12dee3 + 9a2ec4c commit cc0d2da

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

builtin/add.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,10 @@ int cmd_add(int argc,
475475
die_in_unpopulated_submodule(repo->index, prefix);
476476
die_path_inside_submodule(repo->index, &pathspec);
477477

478+
enable_fscache(1);
479+
/* We do not really re-read the index but update the up-to-date flags */
480+
preload_index(repo->index, &pathspec, 0);
481+
478482
if (add_new_files) {
479483
int baselen;
480484

@@ -587,5 +591,6 @@ int cmd_add(int argc,
587591
free(ps_matched);
588592
dir_clear(&dir);
589593
clear_pathspec(&pathspec);
594+
enable_fscache(0);
590595
return exit_status;
591596
}

0 commit comments

Comments
 (0)