diff --git a/builtin/add.c b/builtin/add.c index b773b5a499..d57366aff8 100644 --- a/builtin/add.c +++ b/builtin/add.c @@ -577,6 +577,10 @@ int cmd_add(int argc, const char **argv, const char *prefix) die_in_unpopulated_submodule(&the_index, prefix); die_path_inside_submodule(&the_index, &pathspec); + enable_fscache(1); + /* We do not really re-read the index but update the up-to-date flags */ + preload_index(&the_index, &pathspec, 0); + dir_init(&dir); if (add_new_files) { int baselen; @@ -679,6 +683,7 @@ finish: die(_("Unable to write new index file")); dir_clear(&dir); + enable_fscache(0); UNLEAK(pathspec); return exit_status; }