From f3e27a02d598084a0ef5c8dd6b410bd6a5c5299f Mon Sep 17 00:00:00 2001 From: Phillip Wood Date: Wed, 4 Nov 2020 15:29:38 +0000 Subject: rebase -i: use struct object_id rather than looking up commit We already have a struct object_id containing the oid that we want to set ORIG_HEAD to so use that rather than converting it to a string and then calling get_oid() on that string. Signed-off-by: Phillip Wood Signed-off-by: Junio C Hamano --- sequencer.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sequencer.h') diff --git a/sequencer.h b/sequencer.h index b2a501e445..ea56825488 100644 --- a/sequencer.h +++ b/sequencer.h @@ -163,8 +163,9 @@ void todo_list_add_exec_commands(struct todo_list *todo_list, struct string_list *commands); int complete_action(struct repository *r, struct replay_opts *opts, unsigned flags, const char *shortrevisions, const char *onto_name, - struct commit *onto, const char *orig_head, struct string_list *commands, - unsigned autosquash, struct todo_list *todo_list); + struct commit *onto, const struct object_id *orig_head, + struct string_list *commands, unsigned autosquash, + struct todo_list *todo_list); int todo_list_rearrange_squash(struct todo_list *todo_list); /* -- cgit v1.2.3 From a2bb10d06db8a90920f1f518705a0bb9d39aa1db Mon Sep 17 00:00:00 2001 From: Phillip Wood Date: Wed, 4 Nov 2020 15:29:39 +0000 Subject: rebase -i: use struct object_id when writing state Rather than passing a string around pass the struct object_id that the string was created from call oid_hex() when we write the file. Signed-off-by: Phillip Wood Signed-off-by: Junio C Hamano --- sequencer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sequencer.h') diff --git a/sequencer.h b/sequencer.h index ea56825488..cf201f2406 100644 --- a/sequencer.h +++ b/sequencer.h @@ -227,7 +227,7 @@ int read_author_script(const char *path, char **name, char **email, char **date, int allow_missing); void parse_strategy_opts(struct replay_opts *opts, char *raw_opts); int write_basic_state(struct replay_opts *opts, const char *head_name, - struct commit *onto, const char *orig_head); + struct commit *onto, const struct object_id *orig_head); void sequencer_post_commit_cleanup(struct repository *r, int verbose); int sequencer_get_last_command(struct repository* r, enum replay_action *action); -- cgit v1.2.3