diff --git a/builtin/add.c b/builtin/add.c index 5126d2ede3..b6a4182b94 100644 --- a/builtin/add.c +++ b/builtin/add.c @@ -467,6 +467,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); + if (add_new_files) { int baselen; @@ -572,5 +576,6 @@ finish: dir_clear(&dir); clear_pathspec(&pathspec); + enable_fscache(0); return exit_status; }