diff --git a/builtin/add.c b/builtin/add.c index 78dfb265776724..0fd8d22af9eb7f 100644 --- a/builtin/add.c +++ b/builtin/add.c @@ -477,6 +477,10 @@ int cmd_add(int argc, die_in_unpopulated_submodule(repo->index, prefix); die_path_inside_submodule(repo->index, &pathspec); + enable_fscache(1); + /* We do not really re-read the index but update the up-to-date flags */ + preload_index(repo->index, &pathspec, 0); + if (add_new_files) { int baselen; @@ -589,5 +593,6 @@ int cmd_add(int argc, free(ps_matched); dir_clear(&dir); clear_pathspec(&pathspec); + enable_fscache(0); return exit_status; }