Skip to content

Commit f11c958

Browse files
pcloudsgitster
authored andcommitted
sequencer.c: remove implicit dependency on the_index
Since we're going to pass 'struct repository *' around most of the time instead of 'struct index_state *' because most sequencer.c operations need more than just the index, the_repository is replaced as well in the functions that now take 'struct repository *'. the_repository is still present in this file, but total clean up will be done later. It's not the main focus of this patch. Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6c6d5d0 commit f11c958

File tree

6 files changed

+197
-152
lines changed

6 files changed

+197
-152
lines changed

builtin/commit.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1679,7 +1679,8 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
16791679
flags |= SUMMARY_INITIAL_COMMIT;
16801680
if (author_date_is_interesting())
16811681
flags |= SUMMARY_SHOW_AUTHOR_DATE;
1682-
print_commit_summary(prefix, &oid, flags);
1682+
print_commit_summary(the_repository, prefix,
1683+
&oid, flags);
16831684
}
16841685

16851686
UNLEAK(err);

builtin/merge.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ static int suggest_conflicts(void)
896896
filename = git_path_merge_msg(the_repository);
897897
fp = xfopen(filename, "a");
898898

899-
append_conflicts_hint(&msgbuf);
899+
append_conflicts_hint(&the_index, &msgbuf);
900900
fputs(msgbuf.buf, fp);
901901
strbuf_release(&msgbuf);
902902
fclose(fp);

builtin/rebase--interactive.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ static int do_interactive_rebase(struct replay_opts *opts, unsigned flags,
105105
if (restrict_revision)
106106
argv_array_push(&make_script_args, restrict_revision);
107107

108-
ret = sequencer_make_script(todo_list,
108+
ret = sequencer_make_script(the_repository, todo_list,
109109
make_script_args.argc, make_script_args.argv,
110110
flags);
111111
fclose(todo_list);
@@ -235,7 +235,7 @@ int cmd_rebase__interactive(int argc, const char **argv, const char *prefix)
235235
rerere_clear(&merge_rr);
236236
/* fallthrough */
237237
case CONTINUE:
238-
ret = sequencer_continue(&opts);
238+
ret = sequencer_continue(the_repository, &opts);
239239
break;
240240
}
241241
case EDIT_TODO:

builtin/revert.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,10 @@ static int run_sequencer(int argc, const char **argv, struct replay_opts *opts)
199199
return ret;
200200
}
201201
if (cmd == 'c')
202-
return sequencer_continue(opts);
202+
return sequencer_continue(the_repository, opts);
203203
if (cmd == 'a')
204204
return sequencer_rollback(opts);
205-
return sequencer_pick_revisions(opts);
205+
return sequencer_pick_revisions(the_repository, opts);
206206
}
207207

208208
int cmd_revert(int argc, const char **argv, const char *prefix)

0 commit comments

Comments
 (0)