Skip to content

Commit 8638114

Browse files
agrngitster
authored andcommitted
sequencer: update `total_nr' when adding an item to a todo list
`total_nr' is the total number of items, counting both done and todo, that are in a todo list. But unlike `nr', it was not updated when an item was appended to the list. This variable is mostly used by command prompts (ie. git-prompt.sh and the like). By forgetting to update it, the original code made it not reflect the reality, but this flaw was masked by the code calling unnecessarily read_populate_todo() again to update the variable to its correct value. At the end of this series, the unnecessary call will be removed, and the inconsistency addressed by this patch would start to matter. Signed-off-by: Alban Gruin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bc12974 commit 8638114

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

sequencer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2070,6 +2070,7 @@ void todo_list_release(struct todo_list *todo_list)
20702070
static struct todo_item *append_new_todo(struct todo_list *todo_list)
20712071
{
20722072
ALLOC_GROW(todo_list->items, todo_list->nr + 1, todo_list->alloc);
2073+
todo_list->total_nr++;
20732074
return todo_list->items + todo_list->nr++;
20742075
}
20752076

0 commit comments

Comments
 (0)