Skip to content

Commit 775550c

Browse files
committed
Merge pull request #971 from jeffhostetler/jeffhostetler/add_preload_fscache
add: use preload-index and fscache for performance
2 parents 42d9eaf + b277216 commit 775550c

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

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

@@ -571,5 +575,6 @@ int cmd_add(int argc, const char **argv, const char *prefix)
571575

572576
dir_clear(&dir);
573577
clear_pathspec(&pathspec);
578+
enable_fscache(0);
574579
return exit_status;
575580
}

0 commit comments

Comments
 (0)