Skip to content

Commit 48d1954

Browse files
committed
Merge pull request #971 from jeffhostetler/jeffhostetler/add_preload_fscache
add: use preload-index and fscache for performance
2 parents c368276 + a0518a9 commit 48d1954

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
@@ -464,6 +464,10 @@ int cmd_add(int argc, const char **argv, const char *prefix)
464464
die_in_unpopulated_submodule(&the_index, prefix);
465465
die_path_inside_submodule(&the_index, &pathspec);
466466

467+
enable_fscache(1);
468+
/* We do not really re-read the index but update the up-to-date flags */
469+
preload_index(&the_index, &pathspec, 0);
470+
467471
if (add_new_files) {
468472
int baselen;
469473

@@ -570,5 +574,6 @@ int cmd_add(int argc, const char **argv, const char *prefix)
570574

571575
dir_clear(&dir);
572576
clear_pathspec(&pathspec);
577+
enable_fscache(0);
573578
return exit_status;
574579
}

0 commit comments

Comments
 (0)