[v1,2/5] sequencer: update `done_nr' when skipping commands in a todo list
diff mbox series

Message ID 20190925201315.19722-3-alban.gruin@gmail.com
State New
Headers show
  • [v1,1/5] sequencer: update `total_nr' when adding an item to a todo list
Related show

Commit Message

Alban Gruin Sept. 25, 2019, 8:13 p.m. UTC
In a todo list, `done_nr' is the amount of commands that were executed
or skipped, but skip_unnecessary_picks() did not update it.

This variable is mostly used by command prompts (ie. git-prompt.sh and
the like).

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
 sequencer.c | 1 +
 1 file changed, 1 insertion(+)

diff mbox series

diff --git a/sequencer.c b/sequencer.c
index 575b852a5a..42313f8de6 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -5054,6 +5054,7 @@  static int skip_unnecessary_picks(struct repository *r,
 		MOVE_ARRAY(todo_list->items, todo_list->items + i, todo_list->nr - i);
 		todo_list->nr -= i;
 		todo_list->current = 0;
+		todo_list->done_nr += i;
 		if (is_fixup(peek_command(todo_list, 0)))
 			record_in_rewritten(base_oid, peek_command(todo_list, 0));