Merge branch 'kb/preload-index-more'
Use preloadindex in more places, which has a nice speedup on systems with slow stat calls (and even on Linux). * kb/preload-index-more: update-index/diff-index: use core.preloadindex to improve performance
This commit is contained in:
@ -130,8 +130,6 @@ static int builtin_diff_index(struct rev_info *revs,
|
||||
usage(builtin_diff_usage);
|
||||
argv++; argc--;
|
||||
}
|
||||
if (!cached)
|
||||
setup_work_tree();
|
||||
/*
|
||||
* Make sure there is one revision (i.e. pending object),
|
||||
* and there is no revision filtering parameters.
|
||||
@ -140,8 +138,14 @@ static int builtin_diff_index(struct rev_info *revs,
|
||||
revs->max_count != -1 || revs->min_age != -1 ||
|
||||
revs->max_age != -1)
|
||||
usage(builtin_diff_usage);
|
||||
if (read_cache_preload(revs->diffopt.pathspec.raw) < 0) {
|
||||
perror("read_cache_preload");
|
||||
if (!cached) {
|
||||
setup_work_tree();
|
||||
if (read_cache_preload(revs->diffopt.pathspec.raw) < 0) {
|
||||
perror("read_cache_preload");
|
||||
return -1;
|
||||
}
|
||||
} else if (read_cache() < 0) {
|
||||
perror("read_cache");
|
||||
return -1;
|
||||
}
|
||||
return run_diff_index(revs, cached);
|
||||
|
||||
Reference in New Issue
Block a user