Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictoria Dye <vdye@github.com>2022-11-10 22:06:05 +0300
committerTaylor Blau <me@ttaylorr.com>2022-11-11 05:49:34 +0300
commit652bd0211d456be052ff3e884a5e29b74ff824c0 (patch)
tree1c8c4df0ec794ee10db8b53f1c3d6c8300e26575 /sequencer.c
parentdc5d40f5bc4d93dcc57ee82c5ca8d1369055d8cb (diff)
rebase: use 'skip_cache_tree_update' option
Enable the 'skip_cache_tree_update' option in both 'do_reset()' ('sequencer.c') and 'reset_head()' ('reset.c'). Both of these callers invoke 'prime_cache_tree()' after 'unpack_trees()', so we can remove an unnecessary cache tree rebuild by skipping 'cache_tree_update()'. When testing with 'p3400-rebase.sh' and 'p3404-rebase-interactive.sh', the performance change of this update was negligible, likely due to the operation being dominated by more expensive operations (like checking out trees). However, since the change doesn't harm performance, it's worth keeping this 'unpack_trees()' usage consistent with others that subsequently invoke 'prime_cache_tree()'. Signed-off-by: Victoria Dye <vdye@github.com> Signed-off-by: Taylor Blau <me@ttaylorr.com>
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sequencer.c b/sequencer.c
index f0f1af4d47..0c60800ad1 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -3748,6 +3748,7 @@ static int do_reset(struct repository *r,
unpack_tree_opts.merge = 1;
unpack_tree_opts.update = 1;
unpack_tree_opts.preserve_ignored = 0; /* FIXME: !overwrite_ignore */
+ unpack_tree_opts.skip_cache_tree_update = 1;
init_checkout_metadata(&unpack_tree_opts.meta, name, &oid, NULL);
if (repo_read_index_unmerged(r)) {