Skip to content

Commit 61ef2db

Browse files
committed
Merge pull request #971 from jeffhostetler/jeffhostetler/add_preload_fscache
add: use preload-index and fscache for performance
2 parents 6ea0781 + f0eabf5 commit 61ef2db

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
@@ -553,6 +553,10 @@ int cmd_add(int argc, const char **argv, const char *prefix)
553553
die_in_unpopulated_submodule(&the_index, prefix);
554554
die_path_inside_submodule(&the_index, &pathspec);
555555

556+
enable_fscache(1);
557+
/* We do not really re-read the index but update the up-to-date flags */
558+
preload_index(&the_index, &pathspec, 0);
559+
556560
if (add_new_files) {
557561
int baselen;
558562

@@ -656,5 +660,6 @@ int cmd_add(int argc, const char **argv, const char *prefix)
656660

657661
dir_clear(&dir);
658662
clear_pathspec(&pathspec);
663+
enable_fscache(0);
659664
return exit_status;
660665
}

0 commit comments

Comments
 (0)