Commit 5aa2ac6de1622308884fd542f7b29e6810a0e98e

Edward Thomson 2014-03-11T22:47:39

Update git_merge_tree_opts to git_merge_options

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
diff --git a/include/git2/merge.h b/include/git2/merge.h
index 15bed2a..7065cbc 100644
--- a/include/git2/merge.h
+++ b/include/git2/merge.h
@@ -216,22 +216,22 @@ typedef struct {
 
 	/** Flags for handling conflicting content. */
 	git_merge_file_favor_t file_favor;
-} git_merge_tree_opts;
+} git_merge_options;
 
-#define GIT_MERGE_TREE_OPTS_VERSION 1
-#define GIT_MERGE_TREE_OPTS_INIT {GIT_MERGE_TREE_OPTS_VERSION}
+#define GIT_MERGE_OPTIONS_VERSION 1
+#define GIT_MERGE_OPTIONS_INIT {GIT_MERGE_OPTIONS_VERSION}
 
 /**
- * Initializes a `git_merge_tree_opts` with default values. Equivalent to
- * creating an instance with GIT_MERGE_TREE_OPTS_INIT.
+ * Initializes a `git_merge_options` with default values. Equivalent to
+ * creating an instance with GIT_MERGE_OPTIONS_INIT.
  *
- * @param opts the `git_merge_tree_opts` instance to initialize.
+ * @param opts the `git_merge_options` instance to initialize.
  * @param version the version of the struct; you should pass
- *        `GIT_MERGE_TREE_OPTS_VERSION` here.
+ *        `GIT_MERGE_OPTIONS_VERSION` here.
  * @return Zero on success; -1 on failure.
  */
-GIT_EXTERN(int) git_merge_tree_init_opts(
-	git_merge_tree_opts* opts,
+GIT_EXTERN(int) git_merge_init_options(
+	git_merge_options *opts,
 	int version);
 
 /**
@@ -447,7 +447,7 @@ GIT_EXTERN(int) git_merge_trees(
 	const git_tree *ancestor_tree,
 	const git_tree *our_tree,
 	const git_tree *their_tree,
-	const git_merge_tree_opts *opts);
+	const git_merge_options *opts);
 
 /**
  * Merge two commits, producing a `git_index` that reflects the result of
@@ -469,7 +469,7 @@ GIT_EXTERN(int) git_merge_commits(
 	git_repository *repo,
 	const git_commit *our_commit,
 	const git_commit *their_commit,
-	const git_merge_tree_opts *opts);
+	const git_merge_options *opts);
 
 /**
  * Merges the given commit(s) into HEAD and either returns immediately
@@ -496,7 +496,7 @@ GIT_EXTERN(int) git_merge_commits(
  * @param repo the repository to merge
  * @param merge_heads the heads to merge into
  * @param merge_heads_len the number of heads to merge
- * @param checkout_opts merge options
+ * @param merge_opts merge options
  * @param checkout_opts checkout options
  * @return 0 on success or error code
  */
@@ -505,7 +505,7 @@ GIT_EXTERN(int) git_merge(
 	git_repository *repo,
 	const git_merge_head **their_heads,
 	size_t their_heads_len,
-	const git_merge_tree_opts *merge_opts,
+	const git_merge_options *merge_opts,
 	const git_checkout_options *checkout_opts);
 
 /**
diff --git a/include/git2/revert.h b/include/git2/revert.h
index 3f48c4e..3a6beb6 100644
--- a/include/git2/revert.h
+++ b/include/git2/revert.h
@@ -26,12 +26,12 @@ typedef struct {
 	/** For merge commits, the "mainline" is treated as the parent. */
 	unsigned int mainline;
 
-	git_merge_tree_opts merge_tree_opts;
+	git_merge_options merge_opts;
 	git_checkout_options checkout_opts;
 } git_revert_options;
 
 #define GIT_REVERT_OPTIONS_VERSION 1
-#define GIT_REVERT_OPTIONS_INIT {GIT_REVERT_OPTIONS_VERSION, 0, GIT_MERGE_TREE_OPTS_INIT, GIT_CHECKOUT_OPTIONS_INIT}
+#define GIT_REVERT_OPTIONS_INIT {GIT_REVERT_OPTIONS_VERSION, 0, GIT_MERGE_OPTIONS_INIT, GIT_CHECKOUT_OPTIONS_INIT}
 
 /**
  * Initializes a `git_revert_options` with default values. Equivalent to
@@ -66,7 +66,7 @@ int git_revert_commit(
 	git_commit *revert_commit,
 	git_commit *our_commit,
 	unsigned int mainline,
-	const git_merge_tree_opts *merge_tree_opts);
+	const git_merge_options *merge_options);
 
 /**
  * Reverts the given commit, producing changes in the working directory.
diff --git a/src/merge.c b/src/merge.c
index 12e4a3b..589cf43 100644
--- a/src/merge.c
+++ b/src/merge.c
@@ -664,7 +664,7 @@ static int index_entry_similarity_exact(
 	git_index_entry *b,
 	size_t b_idx,
 	void **cache,
-	const git_merge_tree_opts *opts)
+	const git_merge_options *opts)
 {
 	GIT_UNUSED(repo);
 	GIT_UNUSED(a_idx);
@@ -682,7 +682,7 @@ static int index_entry_similarity_calc(
 	void **out,
 	git_repository *repo,
 	git_index_entry *entry,
-	const git_merge_tree_opts *opts)
+	const git_merge_options *opts)
 {
 	git_blob *blob;
 	git_diff_file diff_file = {{{0}}};
@@ -722,7 +722,7 @@ static int index_entry_similarity_inexact(
 	git_index_entry *b,
 	size_t b_idx,
 	void **cache,
-	const git_merge_tree_opts *opts)
+	const git_merge_options *opts)
 {
 	int score = 0;
 	int error = 0;
@@ -759,9 +759,9 @@ static int merge_diff_mark_similarity(
 	git_merge_diff_list *diff_list,
 	struct merge_diff_similarity *similarity_ours,
 	struct merge_diff_similarity *similarity_theirs,
-	int (*similarity_fn)(git_repository *, git_index_entry *, size_t, git_index_entry *, size_t, void **, const git_merge_tree_opts *),
+	int (*similarity_fn)(git_repository *, git_index_entry *, size_t, git_index_entry *, size_t, void **, const git_merge_options *),
 	void **cache,
-	const git_merge_tree_opts *opts)
+	const git_merge_options *opts)
 {
 	size_t i, j;
 	git_merge_diff *conflict_src, *conflict_tgt;
@@ -862,7 +862,7 @@ static void merge_diff_mark_rename_conflict(
 	bool theirs_renamed,
 	size_t theirs_source_idx,
 	git_merge_diff *target,
-	const git_merge_tree_opts *opts)
+	const git_merge_options *opts)
 {
 	git_merge_diff *ours_source = NULL, *theirs_source = NULL;
 
@@ -932,7 +932,7 @@ static void merge_diff_list_coalesce_renames(
 	git_merge_diff_list *diff_list,
 	struct merge_diff_similarity *similarity_ours,
 	struct merge_diff_similarity *similarity_theirs,
-	const git_merge_tree_opts *opts)
+	const git_merge_options *opts)
 {
 	size_t i;
 	bool ours_renamed = 0, theirs_renamed = 0;
@@ -1022,7 +1022,7 @@ static void merge_diff_list_count_candidates(
 int git_merge_diff_list__find_renames(
 	git_repository *repo,
 	git_merge_diff_list *diff_list,
-	const git_merge_tree_opts *opts)
+	const git_merge_options *opts)
 {
 	struct merge_diff_similarity *similarity_ours, *similarity_theirs;
 	void **cache = NULL;
@@ -1450,10 +1450,10 @@ void git_merge_diff_list__free(git_merge_diff_list *diff_list)
 	git__free(diff_list);
 }
 
-static int merge_tree_normalize_opts(
+static int merge_normalize_opts(
 	git_repository *repo,
-	git_merge_tree_opts *opts,
-	const git_merge_tree_opts *given)
+	git_merge_options *opts,
+	const git_merge_options *given)
 {
 	git_config *cfg = NULL;
 	int error = 0;
@@ -1464,9 +1464,9 @@ static int merge_tree_normalize_opts(
 		return error;
 
 	if (given != NULL)
-		memcpy(opts, given, sizeof(git_merge_tree_opts));
+		memcpy(opts, given, sizeof(git_merge_options));
 	else {
-		git_merge_tree_opts init = GIT_MERGE_TREE_OPTS_INIT;
+		git_merge_options init = GIT_MERGE_OPTIONS_INIT;
 		memcpy(opts, &init, sizeof(init));
 
 		opts->flags = GIT_MERGE_TREE_FIND_RENAMES;
@@ -1634,10 +1634,10 @@ int git_merge_trees(
 	const git_tree *ancestor_tree,
 	const git_tree *our_tree,
 	const git_tree *their_tree,
-	const git_merge_tree_opts *given_opts)
+	const git_merge_options *given_opts)
 {
 	git_merge_diff_list *diff_list;
-	git_merge_tree_opts opts;
+	git_merge_options opts;
 	git_merge_diff *conflict;
 	git_vector changes;
 	size_t i;
@@ -1647,9 +1647,9 @@ int git_merge_trees(
 
 	*out = NULL;
 
-	GITERR_CHECK_VERSION(given_opts, GIT_MERGE_TREE_OPTS_VERSION, "git_merge_tree_opts");
+	GITERR_CHECK_VERSION(given_opts, GIT_MERGE_OPTIONS_VERSION, "git_merge_options");
 
-	if ((error = merge_tree_normalize_opts(repo, &opts, given_opts)) < 0)
+	if ((error = merge_normalize_opts(repo, &opts, given_opts)) < 0)
 		return error;
 
 	diff_list = git_merge_diff_list__alloc(repo);
@@ -1688,7 +1688,7 @@ int git_merge_commits(
 	git_repository *repo,
 	const git_commit *our_commit,
 	const git_commit *their_commit,
-	const git_merge_tree_opts *opts)
+	const git_merge_options *opts)
 {
 	git_oid ancestor_oid;
 	git_commit *ancestor_commit = NULL;
@@ -2552,7 +2552,7 @@ int git_merge(
 	git_repository *repo,
 	const git_merge_head **their_heads,
 	size_t their_heads_len,
-	const git_merge_tree_opts *merge_opts,
+	const git_merge_options *merge_opts,
 	const git_checkout_options *given_checkout_opts)
 {
 	git_merge_result *result;
@@ -2779,14 +2779,14 @@ void git_merge_head_free(git_merge_head *head)
 	git__free(head);
 }
 
-int git_merge_tree_init_opts(git_merge_tree_opts* opts, int version)
+int git_merge_init_options(git_merge_options *opts, int version)
 {
-	if (version != GIT_MERGE_TREE_OPTS_VERSION) {
-		giterr_set(GITERR_INVALID, "Invalid version %d for git_merge_tree_opts", version);
+	if (version != GIT_MERGE_OPTIONS_VERSION) {
+		giterr_set(GITERR_INVALID, "Invalid version %d for git_merge_options", version);
 		return -1;
 	} else {
-		git_merge_tree_opts o = GIT_MERGE_TREE_OPTS_INIT;
-		memcpy(opts, &o, sizeof(o));
+		git_merge_options default_opts = GIT_MERGE_OPTIONS_INIT;
+		memcpy(opts, &default_opts, sizeof(git_merge_options));
 		return 0;
 	}
 }
diff --git a/src/merge.h b/src/merge.h
index 1bd2020..44c808d 100644
--- a/src/merge.h
+++ b/src/merge.h
@@ -147,7 +147,7 @@ int git_merge_diff_list__find_differences(git_merge_diff_list *merge_diff_list,
 	const git_tree *ours_tree,
 	const git_tree *theirs_tree);
 
-int git_merge_diff_list__find_renames(git_repository *repo, git_merge_diff_list *merge_diff_list, const git_merge_tree_opts *opts);
+int git_merge_diff_list__find_renames(git_repository *repo, git_merge_diff_list *merge_diff_list, const git_merge_options *opts);
 
 void git_merge_diff_list__free(git_merge_diff_list *diff_list);
 
diff --git a/src/revert.c b/src/revert.c
index 8e84463..4039ec3 100644
--- a/src/revert.c
+++ b/src/revert.c
@@ -121,7 +121,7 @@ int git_revert_commit(
 	git_commit *revert_commit,
 	git_commit *our_commit,
 	unsigned int mainline,
-	const git_merge_tree_opts *merge_tree_opts)
+	const git_merge_options *merge_opts)
 {
 	git_commit *parent_commit = NULL;
 	git_tree *parent_tree = NULL, *our_tree = NULL, *revert_tree = NULL;
@@ -152,7 +152,7 @@ int git_revert_commit(
 		(error = git_commit_tree(&our_tree, our_commit)) < 0)
 		goto done;
 
-	error = git_merge_trees(out, repo, revert_tree, our_tree, parent_tree, merge_tree_opts);
+	error = git_merge_trees(out, repo, revert_tree, our_tree, parent_tree, merge_opts);
 
 done:
 	git_tree_free(parent_tree);
@@ -198,7 +198,7 @@ int git_revert(
 		(error = write_merge_msg(repo, commit_oidstr, commit_msg)) < 0 ||
 		(error = git_repository_head(&our_ref, repo)) < 0 ||
 		(error = git_reference_peel((git_object **)&our_commit, our_ref, GIT_OBJ_COMMIT)) < 0 ||
-		(error = git_revert_commit(&index_new, repo, commit, our_commit, opts.mainline, &opts.merge_tree_opts)) < 0 ||
+		(error = git_revert_commit(&index_new, repo, commit, our_commit, opts.mainline, &opts.merge_opts)) < 0 ||
 		(error = git_merge__indexes(repo, index_new)) < 0 ||
 		(error = git_repository_index(&index_repo, repo)) < 0 ||
 		(error = git_checkout_index(repo, index_repo, &opts.checkout_opts)) < 0)
diff --git a/tests/merge/merge_helpers.c b/tests/merge/merge_helpers.c
index e3c2b9e..53a0e7b 100644
--- a/tests/merge/merge_helpers.c
+++ b/tests/merge/merge_helpers.c
@@ -10,7 +10,7 @@
 int merge_trees_from_branches(
 	git_index **index, git_repository *repo,
 	const char *ours_name, const char *theirs_name,
-	git_merge_tree_opts *opts)
+	git_merge_options *opts)
 {
 	git_commit *our_commit, *their_commit, *ancestor_commit = NULL;
 	git_tree *our_tree, *their_tree, *ancestor_tree = NULL;
@@ -55,7 +55,7 @@ int merge_trees_from_branches(
 int merge_commits_from_branches(
 	git_index **index, git_repository *repo,
 	const char *ours_name, const char *theirs_name,
-	git_merge_tree_opts *opts)
+	git_merge_options *opts)
 {
 	git_commit *our_commit, *their_commit;
 	git_oid our_oid, their_oid;
@@ -81,7 +81,7 @@ int merge_commits_from_branches(
 
 int merge_branches(git_merge_result **result, git_repository *repo,
 	const char *ours_branch, const char *theirs_branch,
-	git_merge_tree_opts *merge_opts, git_checkout_options *checkout_opts)
+	git_merge_options *merge_opts, git_checkout_options *checkout_opts)
 {
 	git_reference *head_ref, *theirs_ref;
 	git_merge_head *theirs_head;
diff --git a/tests/merge/merge_helpers.h b/tests/merge/merge_helpers.h
index e5dc34b..71f8446 100644
--- a/tests/merge/merge_helpers.h
+++ b/tests/merge/merge_helpers.h
@@ -85,16 +85,16 @@ struct merge_index_conflict_data {
 int merge_trees_from_branches(
 	git_index **index, git_repository *repo,
 	const char *ours_name, const char *theirs_name,
-	git_merge_tree_opts *opts);
+	git_merge_options *opts);
 
 int merge_commits_from_branches(
 	git_index **index, git_repository *repo,
 	const char *ours_name, const char *theirs_name,
-	git_merge_tree_opts *opts);
+	git_merge_options *opts);
 
 int merge_branches(git_merge_result **result, git_repository *repo,
 	const char *ours_branch, const char *theirs_branch,
-	git_merge_tree_opts *merge_opts, git_checkout_options *checkout_opts);
+	git_merge_options *merge_opts, git_checkout_options *checkout_opts);
 
 int merge_test_diff_list(git_merge_diff_list *diff_list, const struct merge_index_entry expected[], size_t expected_len);
 
diff --git a/tests/merge/trees/automerge.c b/tests/merge/trees/automerge.c
index 79069d8..c18881d 100644
--- a/tests/merge/trees/automerge.c
+++ b/tests/merge/trees/automerge.c
@@ -69,7 +69,7 @@ void test_merge_trees_automerge__automerge(void)
 {
 	git_index *index;
 	const git_index_entry *entry;
-	git_merge_tree_opts opts = GIT_MERGE_TREE_OPTS_INIT;
+	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
 	git_blob *blob;
 
 	struct merge_index_entry merge_index_entries[] = {
@@ -109,7 +109,7 @@ void test_merge_trees_automerge__automerge(void)
 void test_merge_trees_automerge__favor_ours(void)
 {
 	git_index *index;
-	git_merge_tree_opts opts = GIT_MERGE_TREE_OPTS_INIT;
+	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
 
 	struct merge_index_entry merge_index_entries[] = {
 		ADDED_IN_MASTER_INDEX_ENTRY,
@@ -140,7 +140,7 @@ void test_merge_trees_automerge__favor_ours(void)
 void test_merge_trees_automerge__favor_theirs(void)
 {
 	git_index *index;
-	git_merge_tree_opts opts = GIT_MERGE_TREE_OPTS_INIT;
+	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
 
 	struct merge_index_entry merge_index_entries[] = {
 		ADDED_IN_MASTER_INDEX_ENTRY,
@@ -171,7 +171,7 @@ void test_merge_trees_automerge__favor_theirs(void)
 void test_merge_trees_automerge__unrelated(void)
 {
 	git_index *index;
-	git_merge_tree_opts opts = GIT_MERGE_TREE_OPTS_INIT;
+	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
 
 	struct merge_index_entry merge_index_entries[] = {
 		{ 0100644, "233c0919c998ed110a4b6ff36f353aec8b713487", 0, "added-in-master.txt" },
diff --git a/tests/merge/trees/commits.c b/tests/merge/trees/commits.c
index 08caf80..c4e4709 100644
--- a/tests/merge/trees/commits.c
+++ b/tests/merge/trees/commits.c
@@ -22,7 +22,7 @@ void test_merge_trees_commits__automerge(void)
 {
 	git_index *index;
 	const git_index_entry *entry;
-	git_merge_tree_opts opts = GIT_MERGE_TREE_OPTS_INIT;
+	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
 	git_blob *blob;
 
 	struct merge_index_entry merge_index_entries[] = {
@@ -71,7 +71,7 @@ void test_merge_trees_commits__automerge(void)
 void test_merge_trees_commits__no_ancestor(void)
 {
 	git_index *index;
-	git_merge_tree_opts opts = GIT_MERGE_TREE_OPTS_INIT;
+	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
 
 	struct merge_index_entry merge_index_entries[] = {
 		{ 0100644, "233c0919c998ed110a4b6ff36f353aec8b713487", 0, "added-in-master.txt" },
@@ -98,7 +98,7 @@ void test_merge_trees_commits__no_ancestor(void)
 void test_merge_trees_commits__df_conflict(void)
 {
 	git_index *index;
-	git_merge_tree_opts opts = GIT_MERGE_TREE_OPTS_INIT;
+	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
 
 	struct merge_index_entry merge_index_entries[] = {
 		{ 0100644, "49130a28ef567af9a6a6104c38773fedfa5f9742", 2, "dir-10" },
diff --git a/tests/merge/trees/renames.c b/tests/merge/trees/renames.c
index 427b6bd..d7721c8 100644
--- a/tests/merge/trees/renames.c
+++ b/tests/merge/trees/renames.c
@@ -27,7 +27,7 @@ void test_merge_trees_renames__cleanup(void)
 void test_merge_trees_renames__index(void)
 {
 	git_index *index;
-	git_merge_tree_opts *opts = NULL;
+	git_merge_options *opts = NULL;
 
 	struct merge_index_entry merge_index_entries[] = {
 		{ 0100644, "68c6c84b091926c7d90aa6a79b2bc3bb6adccd8e", 0, "0a-no-change.txt" },
@@ -205,7 +205,7 @@ void test_merge_trees_renames__index(void)
 void test_merge_trees_renames__no_rename_index(void)
 {
 	git_index *index;
-	git_merge_tree_opts opts = GIT_MERGE_TREE_OPTS_INIT;
+	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
 
 	struct merge_index_entry merge_index_entries[] = {
 		{ 0100644, "68c6c84b091926c7d90aa6a79b2bc3bb6adccd8e", 0, "0a-no-change.txt" },
diff --git a/tests/merge/trees/treediff.c b/tests/merge/trees/treediff.c
index 357859d..2298a30 100644
--- a/tests/merge/trees/treediff.c
+++ b/tests/merge/trees/treediff.c
@@ -44,7 +44,7 @@ static void test_find_differences(
     git_oid ancestor_oid, ours_oid, theirs_oid;
     git_tree *ancestor_tree, *ours_tree, *theirs_tree;
 
-	git_merge_tree_opts opts = GIT_MERGE_TREE_OPTS_INIT;
+	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
 	opts.flags |= GIT_MERGE_TREE_FIND_RENAMES;
 	opts.target_limit = 1000;
 	opts.rename_threshold = 50;
diff --git a/tests/merge/trees/trivial.c b/tests/merge/trees/trivial.c
index 377b247..62a4574 100644
--- a/tests/merge/trees/trivial.c
+++ b/tests/merge/trees/trivial.c
@@ -31,7 +31,7 @@ static int merge_trivial(git_index **index, const char *ours, const char *theirs
 	git_tree *our_tree, *their_tree, *ancestor_tree;
 	git_oid our_oid, their_oid, ancestor_oid;
 	git_buf branch_buf = GIT_BUF_INIT;
-	git_merge_tree_opts opts = GIT_MERGE_TREE_OPTS_INIT;
+	git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
 
 	git_buf_printf(&branch_buf, "%s%s", GIT_REFS_HEADS_DIR, ours);
 	cl_git_pass(git_reference_name_to_id(&our_oid, repo, branch_buf.ptr));
diff --git a/tests/merge/workdir/dirty.c b/tests/merge/workdir/dirty.c
index 61b83a6..99d0d54 100644
--- a/tests/merge/workdir/dirty.c
+++ b/tests/merge/workdir/dirty.c
@@ -90,7 +90,7 @@ static int merge_branch(git_merge_result **result, int merge_file_favor, int che
 {
 	git_oid their_oids[1];
 	git_merge_head *their_heads[1];
-	git_merge_tree_opts merge_opts = GIT_MERGE_TREE_OPTS_INIT;
+	git_merge_options merge_opts = GIT_MERGE_OPTIONS_INIT;
 	git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT;
 	int error;
 
diff --git a/tests/merge/workdir/renames.c b/tests/merge/workdir/renames.c
index 14308ef..915a9d9 100644
--- a/tests/merge/workdir/renames.c
+++ b/tests/merge/workdir/renames.c
@@ -35,7 +35,7 @@ void test_merge_workdir_renames__cleanup(void)
 void test_merge_workdir_renames__renames(void)
 {
 	git_merge_result *result;
-	git_merge_tree_opts merge_opts = GIT_MERGE_TREE_OPTS_INIT;
+	git_merge_options merge_opts = GIT_MERGE_OPTIONS_INIT;
 
 	struct merge_index_entry merge_index_entries[] = {
 		{ 0100644, "68c6c84b091926c7d90aa6a79b2bc3bb6adccd8e", 0, "0a-no-change.txt" },
@@ -77,7 +77,7 @@ void test_merge_workdir_renames__ours(void)
 {
 	git_index *index;
 	git_merge_result *result;
-	git_merge_tree_opts merge_opts = GIT_MERGE_TREE_OPTS_INIT;
+	git_merge_options merge_opts = GIT_MERGE_OPTIONS_INIT;
 	git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT;
 
 	struct merge_index_entry merge_index_entries[] = {
@@ -119,7 +119,7 @@ void test_merge_workdir_renames__ours(void)
 void test_merge_workdir_renames__similar(void)
 {
 	git_merge_result *result;
-	git_merge_tree_opts merge_opts = GIT_MERGE_TREE_OPTS_INIT;
+	git_merge_options merge_opts = GIT_MERGE_OPTIONS_INIT;
 
 	/*
 	 * Note: this differs slightly from the core git merge result - there, 4a is
diff --git a/tests/merge/workdir/simple.c b/tests/merge/workdir/simple.c
index e60b2db..0527832 100644
--- a/tests/merge/workdir/simple.c
+++ b/tests/merge/workdir/simple.c
@@ -97,7 +97,7 @@ static git_merge_result *merge_simple_branch(int merge_file_favor, int checkout_
 	git_oid their_oids[1];
 	git_merge_head *their_heads[1];
 	git_merge_result *result;
-	git_merge_tree_opts merge_opts = GIT_MERGE_TREE_OPTS_INIT;
+	git_merge_options merge_opts = GIT_MERGE_OPTIONS_INIT;
 	git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT;
 
 	cl_git_pass(git_oid_fromstr(&their_oids[0], THEIRS_SIMPLE_OID));
@@ -523,7 +523,7 @@ void test_merge_workdir_simple__directory_file(void)
 	git_oid their_oids[1], head_commit_id;
 	git_merge_head *their_heads[1];
 	git_merge_result *result;
-	git_merge_tree_opts merge_opts = GIT_MERGE_TREE_OPTS_INIT;
+	git_merge_options merge_opts = GIT_MERGE_OPTIONS_INIT;
 	git_commit *head_commit;
 
 	struct merge_index_entry merge_index_entries[] = {
@@ -573,7 +573,7 @@ void test_merge_workdir_simple__unrelated(void)
 	git_oid their_oids[1];
 	git_merge_head *their_heads[1];
 	git_merge_result *result;
-	git_merge_tree_opts merge_opts = GIT_MERGE_TREE_OPTS_INIT;
+	git_merge_options merge_opts = GIT_MERGE_OPTIONS_INIT;
 
 	struct merge_index_entry merge_index_entries[] = {
 		{ 0100644, "233c0919c998ed110a4b6ff36f353aec8b713487", 0, "added-in-master.txt" },
@@ -604,7 +604,7 @@ void test_merge_workdir_simple__unrelated_with_conflicts(void)
 	git_oid their_oids[1];
 	git_merge_head *their_heads[1];
 	git_merge_result *result;
-	git_merge_tree_opts merge_opts = GIT_MERGE_TREE_OPTS_INIT;
+	git_merge_options merge_opts = GIT_MERGE_OPTIONS_INIT;
 
 	struct merge_index_entry merge_index_entries[] = {
 		{ 0100644, "233c0919c998ed110a4b6ff36f353aec8b713487", 0, "added-in-master.txt" },
diff --git a/tests/revert/workdir.c b/tests/revert/workdir.c
index afbdffe..694f247 100644
--- a/tests/revert/workdir.c
+++ b/tests/revert/workdir.c
@@ -398,8 +398,8 @@ void test_revert_workdir__rename_1_of_2(void)
 		{ 0100644, "0f5bfcf58c558d865da6be0281d7795993646cee", 2, "file6.txt" },
 	};
 
-	opts.merge_tree_opts.flags |= GIT_MERGE_TREE_FIND_RENAMES;
-	opts.merge_tree_opts.rename_threshold = 50;
+	opts.merge_opts.flags |= GIT_MERGE_TREE_FIND_RENAMES;
+	opts.merge_opts.rename_threshold = 50;
 
 	git_oid_fromstr(&head_oid, "cef56612d71a6af8d8015691e4865f7fece905b5");
 	cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
@@ -432,8 +432,8 @@ void test_revert_workdir__rename(void)
 		{ "file4.txt", "file5.txt", "" },
 	};
 
-	opts.merge_tree_opts.flags |= GIT_MERGE_TREE_FIND_RENAMES;
-	opts.merge_tree_opts.rename_threshold = 50;
+	opts.merge_opts.flags |= GIT_MERGE_TREE_FIND_RENAMES;
+	opts.merge_opts.rename_threshold = 50;
 
 	git_oid_fromstr(&head_oid, "55568c8de5322ff9a95d72747a239cdb64a19965");
 	cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
diff --git a/tests/structinit/structinit.c b/tests/structinit/structinit.c
index fc44898..2942099 100644
--- a/tests/structinit/structinit.c
+++ b/tests/structinit/structinit.c
@@ -77,8 +77,8 @@ void test_structinit_structinit__compare(void)
 
 	/* merge_tree */
 	CHECK_MACRO_FUNC_INIT_EQUAL( \
-		git_merge_tree_opts, GIT_MERGE_TREE_OPTS_VERSION, \
-		GIT_MERGE_TREE_OPTS_INIT, git_merge_tree_init_opts);
+		git_merge_options, GIT_MERGE_OPTIONS_VERSION, \
+		GIT_MERGE_OPTIONS_INIT, git_merge_init_options);
 
 	/* push */
 	CHECK_MACRO_FUNC_INIT_EQUAL( \