Skip to content

Commit 8ac0907

Browse files
committed
Merge pull request #971 from jeffhostetler/jeffhostetler/add_preload_fscache
add: use preload-index and fscache for performance
2 parents f9d6139 + 1312eda commit 8ac0907

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

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

@@ -572,5 +576,6 @@ int cmd_add(int argc, const char **argv, const char *prefix)
572576

573577
dir_clear(&dir);
574578
clear_pathspec(&pathspec);
579+
enable_fscache(0);
575580
return exit_status;
576581
}

0 commit comments

Comments
 (0)