Git fork

sequencer: pass todo_item to do_pick_commit()

As an additional member of the structure todo_item will be required in
future commits pass the complete structure.

Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Mentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Charvi Mendiratta <charvi077@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Charvi Mendiratta and committed by
Junio C Hamano
ae70e34f 7cdb9682

+11 -7
+11 -7
sequencer.c
··· 1877 1877 } 1878 1878 1879 1879 static int do_pick_commit(struct repository *r, 1880 - enum todo_command command, 1881 - struct commit *commit, 1880 + struct todo_item *item, 1882 1881 struct replay_opts *opts, 1883 1882 int final_fixup, int *check_todo) 1884 1883 { ··· 1891 1890 struct commit_message msg = { NULL, NULL, NULL, NULL }; 1892 1891 struct strbuf msgbuf = STRBUF_INIT; 1893 1892 int res, unborn = 0, reword = 0, allow, drop_commit; 1893 + enum todo_command command = item->command; 1894 + struct commit *commit = item->commit; 1894 1895 1895 1896 if (opts->no_commit) { 1896 1897 /* ··· 4140 4141 setenv(GIT_REFLOG_ACTION, reflog_message(opts, 4141 4142 command_to_string(item->command), NULL), 4142 4143 1); 4143 - res = do_pick_commit(r, item->command, item->commit, 4144 - opts, is_final_fixup(todo_list), 4144 + res = do_pick_commit(r, item, opts, 4145 + is_final_fixup(todo_list), 4145 4146 &check_todo); 4146 4147 if (is_rebase_i(opts)) 4147 4148 setenv(GIT_REFLOG_ACTION, prev_reflog_action, 1); ··· 4603 4604 struct replay_opts *opts) 4604 4605 { 4605 4606 int check_todo; 4607 + struct todo_item item; 4608 + 4609 + item.command = opts->action == REPLAY_PICK ? 4610 + TODO_PICK : TODO_REVERT; 4611 + item.commit = cmit; 4606 4612 4607 4613 setenv(GIT_REFLOG_ACTION, action_name(opts), 0); 4608 - return do_pick_commit(r, opts->action == REPLAY_PICK ? 4609 - TODO_PICK : TODO_REVERT, cmit, opts, 0, 4610 - &check_todo); 4614 + return do_pick_commit(r, &item, opts, 0, &check_todo); 4611 4615 } 4612 4616 4613 4617 int sequencer_pick_revisions(struct repository *r,