Skip to content

Commit ae70e34

Browse files
charvi-077gitster
authored andcommitted
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 <[email protected]> Mentored-by: Phillip Wood <[email protected]> Signed-off-by: Charvi Mendiratta <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7cdb968 commit ae70e34

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

sequencer.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1877,8 +1877,7 @@ static void record_in_rewritten(struct object_id *oid,
18771877
}
18781878

18791879
static int do_pick_commit(struct repository *r,
1880-
enum todo_command command,
1881-
struct commit *commit,
1880+
struct todo_item *item,
18821881
struct replay_opts *opts,
18831882
int final_fixup, int *check_todo)
18841883
{
@@ -1891,6 +1890,8 @@ static int do_pick_commit(struct repository *r,
18911890
struct commit_message msg = { NULL, NULL, NULL, NULL };
18921891
struct strbuf msgbuf = STRBUF_INIT;
18931892
int res, unborn = 0, reword = 0, allow, drop_commit;
1893+
enum todo_command command = item->command;
1894+
struct commit *commit = item->commit;
18941895

18951896
if (opts->no_commit) {
18961897
/*
@@ -4140,8 +4141,8 @@ static int pick_commits(struct repository *r,
41404141
setenv(GIT_REFLOG_ACTION, reflog_message(opts,
41414142
command_to_string(item->command), NULL),
41424143
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),
41454146
&check_todo);
41464147
if (is_rebase_i(opts))
41474148
setenv(GIT_REFLOG_ACTION, prev_reflog_action, 1);
@@ -4603,11 +4604,14 @@ static int single_pick(struct repository *r,
46034604
struct replay_opts *opts)
46044605
{
46054606
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;
46064612

46074613
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);
46114615
}
46124616

46134617
int sequencer_pick_revisions(struct repository *r,

0 commit comments

Comments
 (0)