Skip to content

Commit 4e8e196

Browse files
committed
Merge pull request #971 from jeffhostetler/jeffhostetler/add_preload_fscache
add: use preload-index and fscache for performance
2 parents b539acc + 36c30b0 commit 4e8e196

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

builtin/add.c

+5
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,10 @@ int cmd_add(int argc,
477477
die_in_unpopulated_submodule(repo->index, prefix);
478478
die_path_inside_submodule(repo->index, &pathspec);
479479

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

@@ -589,5 +593,6 @@ int cmd_add(int argc,
589593
free(ps_matched);
590594
dir_clear(&dir);
591595
clear_pathspec(&pathspec);
596+
enable_fscache(0);
592597
return exit_status;
593598
}

0 commit comments

Comments
 (0)