Skip to content

Commit 9ef4f26

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

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
@@ -476,6 +476,10 @@ int cmd_add(int argc,
476476
die_in_unpopulated_submodule(repo->index, prefix);
477477
die_path_inside_submodule(repo->index, &pathspec);
478478

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

@@ -588,5 +592,6 @@ int cmd_add(int argc,
588592
free(ps_matched);
589593
dir_clear(&dir);
590594
clear_pathspec(&pathspec);
595+
enable_fscache(0);
591596
return exit_status;
592597
}

0 commit comments

Comments
 (0)