Merge branch 'bp/add-diff-files-optim'
"git add" needs to internally run "diff-files" equivalent, and the codepath learned the same optimization as "diff-files" has to run lstat(2) in parallel to find which paths have been updated in the working tree. * bp/add-diff-files-optim: add: speed up cmd_add() by utilizing read_cache_preload()
This commit is contained in:
commit
9235a6ce47
@ -445,11 +445,6 @@ int cmd_add(int argc, const char **argv, const char *prefix)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (read_cache() < 0)
|
||||
die(_("index file corrupt"));
|
||||
|
||||
die_in_unpopulated_submodule(&the_index, prefix);
|
||||
|
||||
/*
|
||||
* Check the "pathspec '%s' did not match any files" block
|
||||
* below before enabling new magic.
|
||||
@ -459,6 +454,10 @@ int cmd_add(int argc, const char **argv, const char *prefix)
|
||||
PATHSPEC_SYMLINK_LEADING_PATH,
|
||||
prefix, argv);
|
||||
|
||||
if (read_cache_preload(&pathspec) < 0)
|
||||
die(_("index file corrupt"));
|
||||
|
||||
die_in_unpopulated_submodule(&the_index, prefix);
|
||||
die_path_inside_submodule(&the_index, &pathspec);
|
||||
|
||||
if (add_new_files) {
|
||||
|
Loading…
Reference in New Issue
Block a user