summaryrefslogtreecommitdiff
path: root/sequencer.c
diff options
context:
space:
mode:
authorAlban Gruin <alban.gruin@gmail.com>2019-03-05 19:18:05 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-03-07 00:17:57 (GMT)
commited35d18841130fee0109cbe40b659275a3f78cc9 (patch)
tree528e12705e2e06abf5ed26d6309cbf2d504cdd79 /sequencer.c
parent1451d0f616fb1a046349cc8cd94736bcfde5e4a5 (diff)
downloadgit-ed35d18841130fee0109cbe40b659275a3f78cc9.zip
git-ed35d18841130fee0109cbe40b659275a3f78cc9.tar.gz
git-ed35d18841130fee0109cbe40b659275a3f78cc9.tar.bz2
rebase--interactive: move transform_todo_file()
As transform_todo_file() is only needed inside of rebase--interactive.c for `rebase -p', it is moved there from sequencer.c. The parameter r (repository) is dropped along the way. Signed-off-by: Alban Gruin <alban.gruin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c23
1 files changed, 0 insertions, 23 deletions
diff --git a/sequencer.c b/sequencer.c
index c56c3ad..2a0fcb1 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -4632,29 +4632,6 @@ int todo_list_write_to_file(struct repository *r, struct todo_list *todo_list,
return res;
}
-int transform_todo_file(struct repository *r, unsigned flags)
-{
- const char *todo_file = rebase_path_todo();
- struct todo_list todo_list = TODO_LIST_INIT;
- int res;
-
- if (strbuf_read_file(&todo_list.buf, todo_file, 0) < 0)
- return error_errno(_("could not read '%s'."), todo_file);
-
- if (todo_list_parse_insn_buffer(r, todo_list.buf.buf, &todo_list)) {
- todo_list_release(&todo_list);
- return error(_("unusable todo list: '%s'"), todo_file);
- }
-
- res = todo_list_write_to_file(r, &todo_list, todo_file,
- NULL, NULL, -1, flags);
- todo_list_release(&todo_list);
-
- if (res)
- return error_errno(_("could not write '%s'."), todo_file);
- return 0;
-}
-
static const char edit_todo_list_advice[] =
N_("You can fix this with 'git rebase --edit-todo' "
"and then run 'git rebase --continue'.\n"