Skip to content

Commit 005af33

Browse files
pcloudsgitster
authored andcommitted
sequencer.c: remove implicit dependency on the_repository
Note that the_hash_algo stays, even if we can easily replace it with repo->hash_algo. My reason is I still believe tying hash_algo to a struct repository is a wrong move. But if I'm wrong, we can always go for another round of conversion. Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f11c958 commit 005af33

File tree

5 files changed

+86
-77
lines changed

5 files changed

+86
-77
lines changed

builtin/rebase--interactive.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ static int do_interactive_rebase(struct replay_opts *opts, unsigned flags,
114114
error(_("could not generate todo list"));
115115
else {
116116
discard_cache();
117-
ret = complete_action(opts, flags, shortrevisions, onto_name, onto,
117+
ret = complete_action(the_repository, opts, flags,
118+
shortrevisions, onto_name, onto,
118119
head_hash, cmd, autosquash);
119120
}
120121

@@ -252,16 +253,16 @@ int cmd_rebase__interactive(int argc, const char **argv, const char *prefix)
252253
}
253254
case SHORTEN_OIDS:
254255
case EXPAND_OIDS:
255-
ret = transform_todos(flags);
256+
ret = transform_todos(the_repository, flags);
256257
break;
257258
case CHECK_TODO_LIST:
258-
ret = check_todo_list();
259+
ret = check_todo_list(the_repository);
259260
break;
260261
case REARRANGE_SQUASH:
261-
ret = rearrange_squash();
262+
ret = rearrange_squash(the_repository);
262263
break;
263264
case ADD_EXEC:
264-
ret = sequencer_add_exec_commands(cmd);
265+
ret = sequencer_add_exec_commands(the_repository, cmd);
265266
break;
266267
default:
267268
BUG("invalid command '%d'", command);

builtin/revert.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ static int run_sequencer(int argc, const char **argv, struct replay_opts *opts)
201201
if (cmd == 'c')
202202
return sequencer_continue(the_repository, opts);
203203
if (cmd == 'a')
204-
return sequencer_rollback(opts);
204+
return sequencer_rollback(the_repository, opts);
205205
return sequencer_pick_revisions(the_repository, opts);
206206
}
207207

rebase-interactive.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ int edit_todo_list(unsigned flags)
6969

7070
strbuf_release(&buf);
7171

72-
transform_todos(flags | TODO_LIST_SHORTEN_IDS);
72+
transform_todos(the_repository, flags | TODO_LIST_SHORTEN_IDS);
7373

7474
if (strbuf_read_file(&buf, todo_file, 0) < 0)
7575
return error_errno(_("could not read '%s'."), todo_file);
@@ -85,7 +85,7 @@ int edit_todo_list(unsigned flags)
8585
if (launch_sequence_editor(todo_file, NULL, NULL))
8686
return -1;
8787

88-
transform_todos(flags & ~(TODO_LIST_SHORTEN_IDS));
88+
transform_todos(the_repository, flags & ~(TODO_LIST_SHORTEN_IDS));
8989

9090
return 0;
9191
}

0 commit comments

Comments
 (0)