diff options
author | Alban Gruin <alban.gruin@gmail.com> | 2019-01-29 16:01:49 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-01-29 21:09:24 +0100 |
commit | 6ca89c6f399b86983c7e93a3c5b918cad8292b47 (patch) | |
tree | 96779580d35445f2e7170db354f85397c99fcea1 /rebase-interactive.h | |
parent | sequencer: introduce todo_list_write_to_file() (diff) | |
download | git-6ca89c6f399b86983c7e93a3c5b918cad8292b47.tar.xz git-6ca89c6f399b86983c7e93a3c5b918cad8292b47.zip |
sequencer: refactor check_todo_list() to work on a todo_list
This refactors check_todo_list() to work on a todo_list to avoid
redundant reads and writes to the disk. The function is renamed
todo_list_check(). The parsing of the two todo lists is left to the
caller.
As rebase -p still need to check the todo list from the disk, a new
function is introduced, check_todo_list_from_file(). It reads the file
from the disk, parses it, pass the todo_list to todo_list_check(), and
writes it back to the disk.
As get_missing_commit_check_level() and the enum
missing_commit_check_level are no longer needed inside of sequencer.c,
they are moved to rebase-interactive.c, and made static again.
Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'rebase-interactive.h')
-rw-r--r-- | rebase-interactive.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/rebase-interactive.h b/rebase-interactive.h index 17b6c9f6d0..187b5032d6 100644 --- a/rebase-interactive.h +++ b/rebase-interactive.h @@ -3,9 +3,11 @@ struct strbuf; struct repository; +struct todo_list; void append_todo_help(unsigned edit_todo, unsigned keep_empty, struct strbuf *buf); int edit_todo_list(struct repository *r, unsigned flags); +int todo_list_check(struct todo_list *old_todo, struct todo_list *new_todo); #endif |