summaryrefslogtreecommitdiff
path: root/sequencer.h
diff options
context:
space:
mode:
authorAlban Gruin <alban.gruin@gmail.com>2019-01-29 15:01:49 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-01-29 20:09:24 (GMT)
commit6ca89c6f399b86983c7e93a3c5b918cad8292b47 (patch)
tree96779580d35445f2e7170db354f85397c99fcea1 /sequencer.h
parent616d7740cfbe65533af8ff1dabcf4e56f6baad5a (diff)
downloadgit-6ca89c6f399b86983c7e93a3c5b918cad8292b47.zip
git-6ca89c6f399b86983c7e93a3c5b918cad8292b47.tar.gz
git-6ca89c6f399b86983c7e93a3c5b918cad8292b47.tar.bz2
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 'sequencer.h')
-rw-r--r--sequencer.h9
1 files changed, 1 insertions, 8 deletions
diff --git a/sequencer.h b/sequencer.h
index 7278f96..217353e 100644
--- a/sequencer.h
+++ b/sequencer.h
@@ -64,12 +64,6 @@ struct replay_opts {
};
#define REPLAY_OPTS_INIT { .action = -1, .current_fixups = STRBUF_INIT }
-enum missing_commit_check_level {
- MISSING_COMMIT_CHECK_IGNORE = 0,
- MISSING_COMMIT_CHECK_WARN,
- MISSING_COMMIT_CHECK_ERROR
-};
-
int write_message(const void *buf, size_t len, const char *filename,
int append_eol);
@@ -154,8 +148,7 @@ int sequencer_make_script(struct repository *r, FILE *out, int argc,
int sequencer_add_exec_commands(struct repository *r, const char *command);
int transform_todo_file(struct repository *r, unsigned flags);
-enum missing_commit_check_level get_missing_commit_check_level(void);
-int check_todo_list(struct repository *r);
+int check_todo_list_from_file(struct repository *r);
int complete_action(struct repository *r, struct replay_opts *opts, unsigned flags,
const char *shortrevisions, const char *onto_name,
const char *onto, const char *orig_head, const char *cmd,