@@ -2573,8 +2573,9 @@ static int check_label_or_ref_arg(enum todo_command command, const char *arg)
2573
2573
return 0 ;
2574
2574
}
2575
2575
2576
- static int parse_insn_line (struct repository * r , struct todo_item * item ,
2577
- const char * buf , const char * bol , char * eol )
2576
+ static int parse_insn_line (struct repository * r , struct replay_opts * opts UNUSED ,
2577
+ struct todo_item * item , const char * buf ,
2578
+ const char * bol , char * eol )
2578
2579
{
2579
2580
struct object_id commit_oid ;
2580
2581
char * end_of_object_name ;
@@ -2708,8 +2709,8 @@ int sequencer_get_last_command(struct repository *r UNUSED, enum replay_action *
2708
2709
return ret ;
2709
2710
}
2710
2711
2711
- int todo_list_parse_insn_buffer (struct repository * r , char * buf ,
2712
- struct todo_list * todo_list )
2712
+ int todo_list_parse_insn_buffer (struct repository * r , struct replay_opts * opts ,
2713
+ char * buf , struct todo_list * todo_list )
2713
2714
{
2714
2715
struct todo_item * item ;
2715
2716
char * p = buf , * next_p ;
@@ -2727,7 +2728,7 @@ int todo_list_parse_insn_buffer(struct repository *r, char *buf,
2727
2728
2728
2729
item = append_new_todo (todo_list );
2729
2730
item -> offset_in_buf = p - todo_list -> buf .buf ;
2730
- if (parse_insn_line (r , item , buf , p , eol )) {
2731
+ if (parse_insn_line (r , opts , item , buf , p , eol )) {
2731
2732
res = error (_ ("invalid line %d: %.*s" ),
2732
2733
i , (int )(eol - p ), p );
2733
2734
item -> command = TODO_COMMENT + 1 ;
@@ -2875,7 +2876,7 @@ static int read_populate_todo(struct repository *r,
2875
2876
if (strbuf_read_file_or_whine (& todo_list -> buf , todo_file ) < 0 )
2876
2877
return -1 ;
2877
2878
2878
- res = todo_list_parse_insn_buffer (r , todo_list -> buf .buf , todo_list );
2879
+ res = todo_list_parse_insn_buffer (r , opts , todo_list -> buf .buf , todo_list );
2879
2880
if (res ) {
2880
2881
if (is_rebase_i (opts ))
2881
2882
return error (_ ("please fix this using "
@@ -2905,7 +2906,7 @@ static int read_populate_todo(struct repository *r,
2905
2906
struct todo_list done = TODO_LIST_INIT ;
2906
2907
2907
2908
if (strbuf_read_file (& done .buf , rebase_path_done (), 0 ) > 0 &&
2908
- !todo_list_parse_insn_buffer (r , done .buf .buf , & done ))
2909
+ !todo_list_parse_insn_buffer (r , opts , done .buf .buf , & done ))
2909
2910
todo_list -> done_nr = count_commands (& done );
2910
2911
else
2911
2912
todo_list -> done_nr = 0 ;
@@ -5251,7 +5252,8 @@ int sequencer_continue(struct repository *r, struct replay_opts *opts)
5251
5252
goto release_todo_list ;
5252
5253
5253
5254
if (file_exists (rebase_path_dropped ())) {
5254
- if ((res = todo_list_check_against_backup (r , & todo_list )))
5255
+ if ((res = todo_list_check_against_backup (r , opts ,
5256
+ & todo_list )))
5255
5257
goto release_todo_list ;
5256
5258
5257
5259
unlink (rebase_path_dropped ());
@@ -6294,7 +6296,7 @@ int complete_action(struct repository *r, struct replay_opts *opts, unsigned fla
6294
6296
return error (_ ("nothing to do" ));
6295
6297
}
6296
6298
6297
- res = edit_todo_list (r , todo_list , & new_todo , shortrevisions ,
6299
+ res = edit_todo_list (r , opts , todo_list , & new_todo , shortrevisions ,
6298
6300
shortonto , flags );
6299
6301
if (res == -1 )
6300
6302
return -1 ;
@@ -6322,7 +6324,7 @@ int complete_action(struct repository *r, struct replay_opts *opts, unsigned fla
6322
6324
strbuf_release (& buf2 );
6323
6325
/* Nothing is done yet, and we're reparsing, so let's reset the count */
6324
6326
new_todo .total_nr = 0 ;
6325
- if (todo_list_parse_insn_buffer (r , new_todo .buf .buf , & new_todo ) < 0 )
6327
+ if (todo_list_parse_insn_buffer (r , opts , new_todo .buf .buf , & new_todo ) < 0 )
6326
6328
BUG ("invalid todo list after expanding IDs:\n%s" ,
6327
6329
new_todo .buf .buf );
6328
6330
0 commit comments