Commit 0e1ba46cfbca0eec00d8af713fc2059158685381

Edward Thomson 2014-01-19T20:03:13

Remove the "merge none" flag The "merge none" (don't automerge) flag was only to aide in merge trivial tests. We can easily determine whether merge trivial resulted in a trivial merge or an automerge by examining the REUC after automerge has completed.

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
diff --git a/include/git2/merge.h b/include/git2/merge.h
index 1888bab..c079ef9 100644
--- a/include/git2/merge.h
+++ b/include/git2/merge.h
@@ -38,14 +38,11 @@ typedef enum {
 	/* Produce a conflict in a file when two similar regions are changed. */
 	GIT_MERGE_FILE_FAVOR_NORMAL = 0,
 
-	/* Do not attempt to produce an automerged file during tree merge. */
-	GIT_MERGE_FILE_FAVOR_NO_MERGE = 1,
-
 	/* Produce a file containing the "ours" side of conflicting regions. */
-	GIT_MERGE_FILE_FAVOR_OURS = 2,
+	GIT_MERGE_FILE_FAVOR_OURS = 1,
 
 	/* Produce a file containing the "theirs" side of conflicting regions. */
-	GIT_MERGE_FILE_FAVOR_THEIRS = 3,
+	GIT_MERGE_FILE_FAVOR_THEIRS = 2,
 } git_merge_file_favor_t;
 
 
diff --git a/src/merge.c b/src/merge.c
index 8554bf0..04c7421 100644
--- a/src/merge.c
+++ b/src/merge.c
@@ -527,9 +527,6 @@ static int merge_conflict_resolve_automerge(
 
 	*resolved = 0;
 
-	if (merge_file_favor == GIT_MERGE_FILE_FAVOR_NO_MERGE)
-		return 0;
-
 	merge_file_opts.favor = merge_file_favor;
 
 	/* Reject D/F conflicts */
@@ -603,16 +600,14 @@ static int merge_conflict_resolve(
 	if ((error = merge_conflict_resolve_trivial(&resolved, diff_list, conflict)) < 0)
 		goto done;
 
-	if (merge_file_favor != GIT_MERGE_FILE_FAVOR_NO_MERGE) {
-		if (!resolved && (error = merge_conflict_resolve_one_removed(&resolved, diff_list, conflict)) < 0)
-			goto done;
+	if (!resolved && (error = merge_conflict_resolve_one_removed(&resolved, diff_list, conflict)) < 0)
+		goto done;
 
-		if (!resolved && (error = merge_conflict_resolve_one_renamed(&resolved, diff_list, conflict)) < 0)
-			goto done;
+	if (!resolved && (error = merge_conflict_resolve_one_renamed(&resolved, diff_list, conflict)) < 0)
+		goto done;
 
-		if (!resolved && (error = merge_conflict_resolve_automerge(&resolved, diff_list, conflict, merge_file_favor)) < 0)
-			goto done;
-	}
+	if (!resolved && (error = merge_conflict_resolve_automerge(&resolved, diff_list, conflict, merge_file_favor)) < 0)
+		goto done;
 
 	*out = resolved;
 
diff --git a/tests/merge/trees/trivial.c b/tests/merge/trees/trivial.c
index 244cd32..2de187b 100644
--- a/tests/merge/trees/trivial.c
+++ b/tests/merge/trees/trivial.c
@@ -25,7 +25,7 @@ void test_merge_trees_trivial__cleanup(void)
 }
 
 
-static int merge_trivial(git_index **index, const char *ours, const char *theirs, bool automerge)
+static int merge_trivial(git_index **index, const char *ours, const char *theirs)
 {
 	git_commit *our_commit, *their_commit, *ancestor_commit;
 	git_tree *our_tree, *their_tree, *ancestor_tree;
@@ -33,8 +33,6 @@ static int merge_trivial(git_index **index, const char *ours, const char *theirs
 	git_buf branch_buf = GIT_BUF_INIT;
 	git_merge_tree_opts opts = GIT_MERGE_TREE_OPTS_INIT;
 
-	opts.file_favor |= automerge ? 0 : GIT_MERGE_FILE_FAVOR_NO_MERGE;
-
 	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));
 	cl_git_pass(git_commit_lookup(&our_commit, repo, &our_oid));
@@ -86,7 +84,7 @@ void test_merge_trees_trivial__2alt(void)
 	git_index *result;
 	const git_index_entry *entry;
 
-	cl_git_pass(merge_trivial(&result, "trivial-2alt", "trivial-2alt-branch", 0));
+	cl_git_pass(merge_trivial(&result, "trivial-2alt", "trivial-2alt-branch"));
 
 	cl_assert(entry = git_index_get_bypath(result, "new-in-branch.txt", 0));
 	cl_assert(git_index_reuc_entrycount(result) == 0);
@@ -101,7 +99,7 @@ void test_merge_trees_trivial__3alt(void)
 	git_index *result;
 	const git_index_entry *entry;
 
-	cl_git_pass(merge_trivial(&result, "trivial-3alt", "trivial-3alt-branch", 0));
+	cl_git_pass(merge_trivial(&result, "trivial-3alt", "trivial-3alt-branch"));
 
 	cl_assert(entry = git_index_get_bypath(result, "new-in-3alt.txt", 0));
 	cl_assert(git_index_reuc_entrycount(result) == 0);
@@ -116,7 +114,7 @@ void test_merge_trees_trivial__4(void)
 	git_index *result;
 	const git_index_entry *entry;
 
-	cl_git_pass(merge_trivial(&result, "trivial-4", "trivial-4-branch", 0));
+	cl_git_pass(merge_trivial(&result, "trivial-4", "trivial-4-branch"));
 
 	cl_assert((entry = git_index_get_bypath(result, "new-and-different.txt", 0)) == NULL);
 	cl_assert(git_index_reuc_entrycount(result) == 0);
@@ -134,7 +132,7 @@ void test_merge_trees_trivial__5alt_1(void)
 	git_index *result;
 	const git_index_entry *entry;
 
-	cl_git_pass(merge_trivial(&result, "trivial-5alt-1", "trivial-5alt-1-branch", 0));
+	cl_git_pass(merge_trivial(&result, "trivial-5alt-1", "trivial-5alt-1-branch"));
 
 	cl_assert(entry = git_index_get_bypath(result, "new-and-same.txt", 0));
 	cl_assert(git_index_reuc_entrycount(result) == 0);
@@ -149,7 +147,7 @@ void test_merge_trees_trivial__5alt_2(void)
 	git_index *result;
 	const git_index_entry *entry;
 
-	cl_git_pass(merge_trivial(&result, "trivial-5alt-2", "trivial-5alt-2-branch", 0));
+	cl_git_pass(merge_trivial(&result, "trivial-5alt-2", "trivial-5alt-2-branch"));
 
 	cl_assert(entry = git_index_get_bypath(result, "modified-to-same.txt", 0));
 	cl_assert(git_index_reuc_entrycount(result) == 0);
@@ -163,26 +161,9 @@ void test_merge_trees_trivial__6(void)
 {
 	git_index *result;
 	const git_index_entry *entry;
-
-	cl_git_pass(merge_trivial(&result, "trivial-6", "trivial-6-branch", 0));
-
-	cl_assert((entry = git_index_get_bypath(result, "removed-in-both.txt", 0)) == NULL);
-	cl_assert(git_index_reuc_entrycount(result) == 0);
-
-	cl_assert(merge_trivial_conflict_entrycount(result) == 1);
-	cl_assert(entry = git_index_get_bypath(result, "removed-in-both.txt", 1));
-
-	git_index_free(result);
-}
-
-/* 6: ancest:ancest+, head:(empty), remote:(empty) = result:no merge */
-void test_merge_trees_trivial__6_automerge(void)
-{
-	git_index *result;
-	const git_index_entry *entry;
 	const git_index_reuc_entry *reuc;
 
-	cl_git_pass(merge_trivial(&result, "trivial-6", "trivial-6-branch", 1));
+	cl_git_pass(merge_trivial(&result, "trivial-6", "trivial-6-branch"));
 
 	cl_assert((entry = git_index_get_bypath(result, "removed-in-both.txt", 0)) == NULL);
 	cl_assert(git_index_reuc_entrycount(result) == 1);
@@ -198,27 +179,9 @@ void test_merge_trees_trivial__8(void)
 {
 	git_index *result;
 	const git_index_entry *entry;
-
-	cl_git_pass(merge_trivial(&result, "trivial-8", "trivial-8-branch", 0));
-
-	cl_assert((entry = git_index_get_bypath(result, "removed-in-8.txt", 0)) == NULL);
-	cl_assert(git_index_reuc_entrycount(result) == 0);
-
-	cl_assert(merge_trivial_conflict_entrycount(result) == 2);
-	cl_assert(entry = git_index_get_bypath(result, "removed-in-8.txt", 1));
-	cl_assert(entry = git_index_get_bypath(result, "removed-in-8.txt", 3));
-
-	git_index_free(result);
-}
-
-/* 8: ancest:ancest^, head:(empty), remote:ancest = result:no merge */
-void test_merge_trees_trivial__8_automerge(void)
-{
-	git_index *result;
-	const git_index_entry *entry;
 	const git_index_reuc_entry *reuc;
 
-	cl_git_pass(merge_trivial(&result, "trivial-8", "trivial-8-branch", 1));
+	cl_git_pass(merge_trivial(&result, "trivial-8", "trivial-8-branch"));
 
 	cl_assert((entry = git_index_get_bypath(result, "removed-in-8.txt", 0)) == NULL);
 
@@ -236,25 +199,7 @@ void test_merge_trees_trivial__7(void)
 	git_index *result;
 	const git_index_entry *entry;
 
-	cl_git_pass(merge_trivial(&result, "trivial-7", "trivial-7-branch", 0));
-
-	cl_assert((entry = git_index_get_bypath(result, "removed-in-7.txt", 0)) == NULL);
-	cl_assert(git_index_reuc_entrycount(result) == 0);
-
-	cl_assert(merge_trivial_conflict_entrycount(result) == 2);
-	cl_assert(entry = git_index_get_bypath(result, "removed-in-7.txt", 1));
-	cl_assert(entry = git_index_get_bypath(result, "removed-in-7.txt", 3));
-
-	git_index_free(result);
-}
-
-/* 7: ancest:ancest+, head:(empty), remote:remote = result:no merge */
-void test_merge_trees_trivial__7_automerge(void)
-{
-	git_index *result;
-	const git_index_entry *entry;
-
-	cl_git_pass(merge_trivial(&result, "trivial-7", "trivial-7-branch", 0));
+	cl_git_pass(merge_trivial(&result, "trivial-7", "trivial-7-branch"));
 
 	cl_assert((entry = git_index_get_bypath(result, "removed-in-7.txt", 0)) == NULL);
 	cl_assert(git_index_reuc_entrycount(result) == 0);
@@ -271,27 +216,9 @@ void test_merge_trees_trivial__10(void)
 {
 	git_index *result;
 	const git_index_entry *entry;
-
-	cl_git_pass(merge_trivial(&result, "trivial-10", "trivial-10-branch", 0));
-
-	cl_assert((entry = git_index_get_bypath(result, "removed-in-10-branch.txt", 0)) == NULL);
-	cl_assert(git_index_reuc_entrycount(result) == 0);
-
-	cl_assert(merge_trivial_conflict_entrycount(result) == 2);
-	cl_assert(entry = git_index_get_bypath(result, "removed-in-10-branch.txt", 1));
-	cl_assert(entry = git_index_get_bypath(result, "removed-in-10-branch.txt", 2));
-
-	git_index_free(result);
-}
-
-/* 10: ancest:ancest^, head:ancest, remote:(empty) = result:no merge */
-void test_merge_trees_trivial__10_automerge(void)
-{
-	git_index *result;
-	const git_index_entry *entry;
 	const git_index_reuc_entry *reuc;
 
-	cl_git_pass(merge_trivial(&result, "trivial-10", "trivial-10-branch", 1));
+	cl_git_pass(merge_trivial(&result, "trivial-10", "trivial-10-branch"));
 
 	cl_assert((entry = git_index_get_bypath(result, "removed-in-10-branch.txt", 0)) == NULL);
 
@@ -309,25 +236,7 @@ void test_merge_trees_trivial__9(void)
 	git_index *result;
 	const git_index_entry *entry;
 
-	cl_git_pass(merge_trivial(&result, "trivial-9", "trivial-9-branch", 0));
-
-	cl_assert((entry = git_index_get_bypath(result, "removed-in-9-branch.txt", 0)) == NULL);
-	cl_assert(git_index_reuc_entrycount(result) == 0);
-
-	cl_assert(merge_trivial_conflict_entrycount(result) == 2);
-	cl_assert(entry = git_index_get_bypath(result, "removed-in-9-branch.txt", 1));
-	cl_assert(entry = git_index_get_bypath(result, "removed-in-9-branch.txt", 2));
-
-	git_index_free(result);
-}
-
-/* 9: ancest:ancest+, head:head, remote:(empty) = result:no merge */
-void test_merge_trees_trivial__9_automerge(void)
-{
-	git_index *result;
-	const git_index_entry *entry;
-
-	cl_git_pass(merge_trivial(&result, "trivial-9", "trivial-9-branch", 1));
+	cl_git_pass(merge_trivial(&result, "trivial-9", "trivial-9-branch"));
 
 	cl_assert((entry = git_index_get_bypath(result, "removed-in-9-branch.txt", 0)) == NULL);
 	cl_assert(git_index_reuc_entrycount(result) == 0);
@@ -346,7 +255,7 @@ void test_merge_trees_trivial__13(void)
 	const git_index_entry *entry;
 	git_oid expected_oid;
 
-	cl_git_pass(merge_trivial(&result, "trivial-13", "trivial-13-branch", 0));
+	cl_git_pass(merge_trivial(&result, "trivial-13", "trivial-13-branch"));
 
 	cl_assert(entry = git_index_get_bypath(result, "modified-in-13.txt", 0));
 	cl_git_pass(git_oid_fromstr(&expected_oid, "1cff9ec6a47a537380dedfdd17c9e76d74259a2b"));
@@ -365,7 +274,7 @@ void test_merge_trees_trivial__14(void)
 	const git_index_entry *entry;
 	git_oid expected_oid;
 
-	cl_git_pass(merge_trivial(&result, "trivial-14", "trivial-14-branch", 0));
+	cl_git_pass(merge_trivial(&result, "trivial-14", "trivial-14-branch"));
 
 	cl_assert(entry = git_index_get_bypath(result, "modified-in-14-branch.txt", 0));
 	cl_git_pass(git_oid_fromstr(&expected_oid, "26153a3ff3649b6c2bb652d3f06878c6e0a172f9"));
@@ -383,7 +292,7 @@ void test_merge_trees_trivial__11(void)
 	git_index *result;
 	const git_index_entry *entry;
 
-	cl_git_pass(merge_trivial(&result, "trivial-11", "trivial-11-branch", 0));
+	cl_git_pass(merge_trivial(&result, "trivial-11", "trivial-11-branch"));
 
 	cl_assert((entry = git_index_get_bypath(result, "modified-in-both.txt", 0)) == NULL);
 	cl_assert(git_index_reuc_entrycount(result) == 0);
diff --git a/tests/merge/workdir/trivial.c b/tests/merge/workdir/trivial.c
index ebf0909..71437d4 100644
--- a/tests/merge/workdir/trivial.c
+++ b/tests/merge/workdir/trivial.c
@@ -28,7 +28,7 @@ void test_merge_workdir_trivial__cleanup(void)
 }
 
 
-static int merge_trivial(const char *ours, const char *theirs, bool automerge)
+static int merge_trivial(const char *ours, const char *theirs)
 {
 	git_buf branch_buf = GIT_BUF_INIT;
 	git_checkout_opts checkout_opts = GIT_CHECKOUT_OPTS_INIT;
@@ -39,8 +39,6 @@ static int merge_trivial(const char *ours, const char *theirs, bool automerge)
 
 	checkout_opts.checkout_strategy = GIT_CHECKOUT_FORCE;
 
-	opts.merge_tree_opts.file_favor |= automerge ? 0 : GIT_MERGE_FILE_FAVOR_NO_MERGE;
-
 	git_buf_printf(&branch_buf, "%s%s", GIT_REFS_HEADS_DIR, ours);
 	cl_git_pass(git_reference_symbolic_create(&our_ref, repo, "HEAD", branch_buf.ptr, 1, NULL, NULL));
 
@@ -83,7 +81,7 @@ void test_merge_workdir_trivial__2alt(void)
 {
 	const git_index_entry *entry;
 
-	cl_git_pass(merge_trivial("trivial-2alt", "trivial-2alt-branch", 0));
+	cl_git_pass(merge_trivial("trivial-2alt", "trivial-2alt-branch"));
 
 	cl_assert(entry = git_index_get_bypath(repo_index, "new-in-branch.txt", 0));
 	cl_assert(git_index_reuc_entrycount(repo_index) == 0);
@@ -95,7 +93,7 @@ void test_merge_workdir_trivial__3alt(void)
 {
 	const git_index_entry *entry;
 
-	cl_git_pass(merge_trivial("trivial-3alt", "trivial-3alt-branch", 0));
+	cl_git_pass(merge_trivial("trivial-3alt", "trivial-3alt-branch"));
 
 	cl_assert(entry = git_index_get_bypath(repo_index, "new-in-3alt.txt", 0));
 	cl_assert(git_index_reuc_entrycount(repo_index) == 0);
@@ -107,7 +105,7 @@ void test_merge_workdir_trivial__4(void)
 {
 	const git_index_entry *entry;
 
-	cl_git_pass(merge_trivial("trivial-4", "trivial-4-branch", 0));
+	cl_git_pass(merge_trivial("trivial-4", "trivial-4-branch"));
 
 	cl_assert((entry = git_index_get_bypath(repo_index, "new-and-different.txt", 0)) == NULL);
 	cl_assert(git_index_reuc_entrycount(repo_index) == 0);
@@ -122,7 +120,7 @@ void test_merge_workdir_trivial__5alt_1(void)
 {
 	const git_index_entry *entry;
 
-	cl_git_pass(merge_trivial("trivial-5alt-1", "trivial-5alt-1-branch", 0));
+	cl_git_pass(merge_trivial("trivial-5alt-1", "trivial-5alt-1-branch"));
 
 	cl_assert(entry = git_index_get_bypath(repo_index, "new-and-same.txt", 0));
 	cl_assert(git_index_reuc_entrycount(repo_index) == 0);
@@ -134,7 +132,7 @@ void test_merge_workdir_trivial__5alt_2(void)
 {
 	const git_index_entry *entry;
 
-	cl_git_pass(merge_trivial("trivial-5alt-2", "trivial-5alt-2-branch", 0));
+	cl_git_pass(merge_trivial("trivial-5alt-2", "trivial-5alt-2-branch"));
 
 	cl_assert(entry = git_index_get_bypath(repo_index, "modified-to-same.txt", 0));
 	cl_assert(git_index_reuc_entrycount(repo_index) == 0);
@@ -145,23 +143,9 @@ void test_merge_workdir_trivial__5alt_2(void)
 void test_merge_workdir_trivial__6(void)
 {
 	const git_index_entry *entry;
-
-	cl_git_pass(merge_trivial("trivial-6", "trivial-6-branch", 0));
-
-	cl_assert((entry = git_index_get_bypath(repo_index, "removed-in-both.txt", 0)) == NULL);
-	cl_assert(git_index_reuc_entrycount(repo_index) == 0);
-
-	cl_assert(merge_trivial_conflict_entrycount() == 1);
-	cl_assert(entry = git_index_get_bypath(repo_index, "removed-in-both.txt", 1));
-}
-
-/* 6: ancest:ancest+, head:(empty), remote:(empty) = result:no merge */
-void test_merge_workdir_trivial__6_automerge(void)
-{
-	const git_index_entry *entry;
 	const git_index_reuc_entry *reuc;
 
-	cl_git_pass(merge_trivial("trivial-6", "trivial-6-branch", 1));
+	cl_git_pass(merge_trivial("trivial-6", "trivial-6-branch"));
 
 	cl_assert((entry = git_index_get_bypath(repo_index, "removed-in-both.txt", 0)) == NULL);
 	cl_assert(git_index_reuc_entrycount(repo_index) == 1);
@@ -174,24 +158,9 @@ void test_merge_workdir_trivial__6_automerge(void)
 void test_merge_workdir_trivial__8(void)
 {
 	const git_index_entry *entry;
-
-	cl_git_pass(merge_trivial("trivial-8", "trivial-8-branch", 0));
-
-	cl_assert((entry = git_index_get_bypath(repo_index, "removed-in-8.txt", 0)) == NULL);
-	cl_assert(git_index_reuc_entrycount(repo_index) == 0);
-
-	cl_assert(merge_trivial_conflict_entrycount() == 2);
-	cl_assert(entry = git_index_get_bypath(repo_index, "removed-in-8.txt", 1));
-	cl_assert(entry = git_index_get_bypath(repo_index, "removed-in-8.txt", 3));
-}
-
-/* 8: ancest:ancest^, head:(empty), remote:ancest = result:no merge */
-void test_merge_workdir_trivial__8_automerge(void)
-{
-	const git_index_entry *entry;
 	const git_index_reuc_entry *reuc;
 
-	cl_git_pass(merge_trivial("trivial-8", "trivial-8-branch", 1));
+	cl_git_pass(merge_trivial("trivial-8", "trivial-8-branch"));
 
 	cl_assert((entry = git_index_get_bypath(repo_index, "removed-in-8.txt", 0)) == NULL);
 
@@ -206,22 +175,7 @@ void test_merge_workdir_trivial__7(void)
 {
 	const git_index_entry *entry;
 
-	cl_git_pass(merge_trivial("trivial-7", "trivial-7-branch", 0));
-
-	cl_assert((entry = git_index_get_bypath(repo_index, "removed-in-7.txt", 0)) == NULL);
-	cl_assert(git_index_reuc_entrycount(repo_index) == 0);
-
-	cl_assert(merge_trivial_conflict_entrycount() == 2);
-	cl_assert(entry = git_index_get_bypath(repo_index, "removed-in-7.txt", 1));
-	cl_assert(entry = git_index_get_bypath(repo_index, "removed-in-7.txt", 3));
-}
-
-/* 7: ancest:ancest+, head:(empty), remote:remote = result:no merge */
-void test_merge_workdir_trivial__7_automerge(void)
-{
-	const git_index_entry *entry;
-
-	cl_git_pass(merge_trivial("trivial-7", "trivial-7-branch", 0));
+	cl_git_pass(merge_trivial("trivial-7", "trivial-7-branch"));
 
 	cl_assert((entry = git_index_get_bypath(repo_index, "removed-in-7.txt", 0)) == NULL);
 	cl_assert(git_index_reuc_entrycount(repo_index) == 0);
@@ -235,24 +189,9 @@ void test_merge_workdir_trivial__7_automerge(void)
 void test_merge_workdir_trivial__10(void)
 {
 	const git_index_entry *entry;
-
-	cl_git_pass(merge_trivial("trivial-10", "trivial-10-branch", 0));
-
-	cl_assert((entry = git_index_get_bypath(repo_index, "removed-in-10-branch.txt", 0)) == NULL);
-	cl_assert(git_index_reuc_entrycount(repo_index) == 0);
-
-	cl_assert(merge_trivial_conflict_entrycount() == 2);
-	cl_assert(entry = git_index_get_bypath(repo_index, "removed-in-10-branch.txt", 1));
-	cl_assert(entry = git_index_get_bypath(repo_index, "removed-in-10-branch.txt", 2));
-}
-
-/* 10: ancest:ancest^, head:ancest, remote:(empty) = result:no merge */
-void test_merge_workdir_trivial__10_automerge(void)
-{
-	const git_index_entry *entry;
 	const git_index_reuc_entry *reuc;
 
-	cl_git_pass(merge_trivial("trivial-10", "trivial-10-branch", 1));
+	cl_git_pass(merge_trivial("trivial-10", "trivial-10-branch"));
 
 	cl_assert((entry = git_index_get_bypath(repo_index, "removed-in-10-branch.txt", 0)) == NULL);
 
@@ -267,22 +206,7 @@ void test_merge_workdir_trivial__9(void)
 {
 	const git_index_entry *entry;
 
-	cl_git_pass(merge_trivial("trivial-9", "trivial-9-branch", 0));
-
-	cl_assert((entry = git_index_get_bypath(repo_index, "removed-in-9-branch.txt", 0)) == NULL);
-	cl_assert(git_index_reuc_entrycount(repo_index) == 0);
-
-	cl_assert(merge_trivial_conflict_entrycount() == 2);
-	cl_assert(entry = git_index_get_bypath(repo_index, "removed-in-9-branch.txt", 1));
-	cl_assert(entry = git_index_get_bypath(repo_index, "removed-in-9-branch.txt", 2));
-}
-
-/* 9: ancest:ancest+, head:head, remote:(empty) = result:no merge */
-void test_merge_workdir_trivial__9_automerge(void)
-{
-	const git_index_entry *entry;
-
-	cl_git_pass(merge_trivial("trivial-9", "trivial-9-branch", 1));
+	cl_git_pass(merge_trivial("trivial-9", "trivial-9-branch"));
 
 	cl_assert((entry = git_index_get_bypath(repo_index, "removed-in-9-branch.txt", 0)) == NULL);
 	cl_assert(git_index_reuc_entrycount(repo_index) == 0);
@@ -298,7 +222,7 @@ void test_merge_workdir_trivial__13(void)
 	const git_index_entry *entry;
 	git_oid expected_oid;
 
-	cl_git_pass(merge_trivial("trivial-13", "trivial-13-branch", 0));
+	cl_git_pass(merge_trivial("trivial-13", "trivial-13-branch"));
 
 	cl_assert(entry = git_index_get_bypath(repo_index, "modified-in-13.txt", 0));
 	cl_git_pass(git_oid_fromstr(&expected_oid, "1cff9ec6a47a537380dedfdd17c9e76d74259a2b"));
@@ -314,7 +238,7 @@ void test_merge_workdir_trivial__14(void)
 	const git_index_entry *entry;
 	git_oid expected_oid;
 
-	cl_git_pass(merge_trivial("trivial-14", "trivial-14-branch", 0));
+	cl_git_pass(merge_trivial("trivial-14", "trivial-14-branch"));
 
 	cl_assert(entry = git_index_get_bypath(repo_index, "modified-in-14-branch.txt", 0));
 	cl_git_pass(git_oid_fromstr(&expected_oid, "26153a3ff3649b6c2bb652d3f06878c6e0a172f9"));
@@ -329,7 +253,7 @@ void test_merge_workdir_trivial__11(void)
 {
 	const git_index_entry *entry;
 
-	cl_git_pass(merge_trivial("trivial-11", "trivial-11-branch", 0));
+	cl_git_pass(merge_trivial("trivial-11", "trivial-11-branch"));
 
 	cl_assert((entry = git_index_get_bypath(repo_index, "modified-in-both.txt", 0)) == NULL);
 	cl_assert(git_index_reuc_entrycount(repo_index) == 0);
diff --git a/tests/revert/workdir.c b/tests/revert/workdir.c
index bca1ff9..5be397c 100644
--- a/tests/revert/workdir.c
+++ b/tests/revert/workdir.c
@@ -343,22 +343,19 @@ void test_revert_workdir__conflict_use_ours(void)
 	git_revert_opts opts = GIT_REVERT_OPTS_INIT;
 
 	struct merge_index_entry merge_index_entries[] = {
-		{ 0100644, "3a3ef367eaf3fe79effbfb0a56b269c04c2b59fe", 1, "file1.txt" },
-		{ 0100644, "7731926a337c4eaba1e2187d90ebfa0a93659382", 2, "file1.txt" },
-		{ 0100644, "747726e021bc5f44b86de60e3032fd6f9f1b8383", 3, "file1.txt" },
+		{ 0100644, "caf99de3a49827117bb66721010eac461b06a80c", 0, "file1.txt" },
 		{ 0100644, "0ab09ea6d4c3634bdf6c221626d8b6f7dd890767", 0, "file2.txt" },
 		{ 0100644, "f4e107c230d08a60fb419d19869f1f282b272d9c", 0, "file3.txt" },
 		{ 0100644, "0f5bfcf58c558d865da6be0281d7795993646cee", 0, "file6.txt" },
 	};
 
 	struct merge_index_entry merge_filesystem_entries[] = {
-		{ 0100644, "7731926a337c4eaba1e2187d90ebfa0a93659382", 0, "file1.txt" },
+		{ 0100644, "caf99de3a49827117bb66721010eac461b06a80c", 0, "file1.txt" },
 		{ 0100644, "0ab09ea6d4c3634bdf6c221626d8b6f7dd890767", 0, "file2.txt" },
 		{ 0100644, "f4e107c230d08a60fb419d19869f1f282b272d9c", 0, "file3.txt" },
 		{ 0100644, "0f5bfcf58c558d865da6be0281d7795993646cee", 0, "file6.txt" },
 	};
 
-	opts.merge_tree_opts.file_favor = GIT_MERGE_FILE_FAVOR_NO_MERGE;
 	opts.checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_USE_OURS;
 
 	git_oid_fromstr(&head_oid, "72333f47d4e83616630ff3b0ffe4c0faebcc3c45");
@@ -369,7 +366,7 @@ void test_revert_workdir__conflict_use_ours(void)
 	cl_git_pass(git_commit_lookup(&commit, repo, &revert_oid));
 	cl_git_pass(git_revert(repo, commit, &opts));
 
-	cl_assert(merge_test_index(repo_index, merge_index_entries, 6));
+	cl_assert(merge_test_index(repo_index, merge_index_entries, 4));
 	cl_assert(merge_test_workdir(repo, merge_filesystem_entries, 4));
 
 	git_commit_free(commit);