diff options
author | Ben Peart <benpeart@microsoft.com> | 2018-11-05 14:27:51 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-11-06 12:49:59 +0900 |
commit | 6c5b7f55a845bccf7b3abda92a78c621898d838d (patch) | |
tree | 351a429fc3c5fb096884ec834a96029938ccc41d /sequencer.c | |
parent | speed up refresh_index() by utilizing preload_index() (diff) | |
download | tgif-6c5b7f55a845bccf7b3abda92a78c621898d838d.tar.xz |
refresh_index: remove unnecessary calls to preload_index()
With refresh_index() learning to utilize preload_index() to speed up its
operation there is no longer any benefit to having the caller preload the
index first. Remove those unneeded calls by calling read_index() instead of
the preload variant.
There is no measurable performance impact of this patch - the 2nd call to
preload_index() bails out quickly but there is no reason to call it twice.
Signed-off-by: Ben Peart <benpeart@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.c')
-rw-r--r-- | sequencer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sequencer.c b/sequencer.c index 0c164d5f98..b46dd0fb63 100644 --- a/sequencer.c +++ b/sequencer.c @@ -1913,7 +1913,7 @@ static int read_and_refresh_cache(struct replay_opts *opts) { struct lock_file index_lock = LOCK_INIT; int index_fd = hold_locked_index(&index_lock, 0); - if (read_index_preload(&the_index, NULL, 0) < 0) { + if (read_index(&the_index) < 0) { rollback_lock_file(&index_lock); return error(_("git %s: failed to read the index"), _(action_name(opts))); |