]> git.ipfire.org Git - thirdparty/git.git/commit
rebase: use 'skip_cache_tree_update' option
authorVictoria Dye <vdye@github.com>
Thu, 10 Nov 2022 19:06:05 +0000 (19:06 +0000)
committerTaylor Blau <me@ttaylorr.com>
Fri, 11 Nov 2022 02:49:34 +0000 (21:49 -0500)
commit652bd0211d456be052ff3e884a5e29b74ff824c0
tree1c8c4df0ec794ee10db8b53f1c3d6c8300e26575
parentdc5d40f5bc4d93dcc57ee82c5ca8d1369055d8cb
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>
reset.c
sequencer.c