@@ -18,11 +18,13 @@ struct notes_merge_pair {
18
18
struct object_id obj , base , local , remote ;
19
19
};
20
20
21
- void init_notes_merge_options (struct notes_merge_options * o )
21
+ void init_notes_merge_options (struct repository * r ,
22
+ struct notes_merge_options * o )
22
23
{
23
24
memset (o , 0 , sizeof (struct notes_merge_options ));
24
25
strbuf_init (& (o -> commit_msg ), 0 );
25
26
o -> verbosity = NOTES_MERGE_VERBOSITY_DEFAULT ;
27
+ o -> repo = r ;
26
28
}
27
29
28
30
static int path_to_oid (const char * path , struct object_id * oid )
@@ -127,7 +129,7 @@ static struct notes_merge_pair *diff_tree_remote(struct notes_merge_options *o,
127
129
trace_printf ("\tdiff_tree_remote(base = %.7s, remote = %.7s)\n" ,
128
130
oid_to_hex (base ), oid_to_hex (remote ));
129
131
130
- repo_diff_setup (the_repository , & opt );
132
+ repo_diff_setup (o -> repo , & opt );
131
133
opt .flags .recursive = 1 ;
132
134
opt .output_format = DIFF_FORMAT_NO_OUTPUT ;
133
135
diff_setup_done (& opt );
@@ -190,7 +192,7 @@ static void diff_tree_local(struct notes_merge_options *o,
190
192
trace_printf ("\tdiff_tree_local(len = %i, base = %.7s, local = %.7s)\n" ,
191
193
len , oid_to_hex (base ), oid_to_hex (local ));
192
194
193
- repo_diff_setup (the_repository , & opt );
195
+ repo_diff_setup (o -> repo , & opt );
194
196
opt .flags .recursive = 1 ;
195
197
opt .output_format = DIFF_FORMAT_NO_OUTPUT ;
196
198
diff_setup_done (& opt );
@@ -350,7 +352,7 @@ static int ll_merge_in_worktree(struct notes_merge_options *o,
350
352
351
353
status = ll_merge (& result_buf , oid_to_hex (& p -> obj ), & base , NULL ,
352
354
& local , o -> local_ref , & remote , o -> remote_ref ,
353
- & the_index , NULL );
355
+ o -> repo -> index , NULL );
354
356
355
357
free (base .ptr );
356
358
free (local .ptr );
@@ -711,7 +713,7 @@ int notes_merge_commit(struct notes_merge_options *o,
711
713
/* write file as blob, and add to partial_tree */
712
714
if (stat (path .buf , & st ))
713
715
die_errno ("Failed to stat '%s'" , path .buf );
714
- if (index_path (& the_index , & blob_oid , path .buf , & st , HASH_WRITE_OBJECT ))
716
+ if (index_path (o -> repo -> index , & blob_oid , path .buf , & st , HASH_WRITE_OBJECT ))
715
717
die ("Failed to write blob object from '%s'" , path .buf );
716
718
if (add_note (partial_tree , & obj_oid , & blob_oid , NULL ))
717
719
die ("Failed to add resolved note '%s' to notes tree" ,
0 commit comments