]> git.ipfire.org Git - thirdparty/git.git/commit
rebase --update-refs: fix loops
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Sat, 13 May 2023 08:11:25 +0000 (08:11 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 15 May 2023 04:44:50 +0000 (21:44 -0700)
commitfa5103dd8913366b031ad8daa11f27e9452638be
tree49739a887493b22929e19a7487ce18654dd7e3c8
parentec583449067bab5b800ecc63926f35c9dae96fa1
rebase --update-refs: fix loops

The `total_nr` field in the `todo_list` structure merely serves display
purposes, and should only be used when generating the progress message.

In these two instances, however, we want to loop over all of the
commands in the parsed rebase script. The loop limit therefore needs to
be `nr`, which refers to the count of commands in the current
`todo_list`.

This is important because the two numbers, `nr` and `total_nr` can
differ wildly, e.g. due to `total_nr` _not_ counting comments or empty
lines, while `nr` skips any commands that already moved from the
`git-rebase-todo` file to the `done` file.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c