Branch Coverage

deps/libgit2/src/libgit2/merge.c
Criterion Covered Total %
branch 581 1320 44.0


line true false branch
92 0 19 if (length < 2) {
97 0 19 if (git_vector_init(&list, length - 1, NULL) < 0)
100 0 19 if (git_revwalk_new(&walk, repo) < 0)
103 19 19 for (i = 1; i < length; i++) {
105 0 19 if (commit == NULL)
112 0 19 if (commit == NULL)
115 0 19 if (git_merge__bases_many(&result, walk, commit, &list, 0) < 0)
118 0 19 if (!result) {
142 0 13 GIT_ASSERT_ARG(out);
143 0 13 GIT_ASSERT_ARG(repo);
144 0 13 GIT_ASSERT_ARG(input_array);
146 0 13 if ((error = merge_bases_many(&result, &walk, repo, length, input_array)) < 0)
164 0 6 GIT_ASSERT_ARG(out);
165 0 6 GIT_ASSERT_ARG(repo);
166 0 6 GIT_ASSERT_ARG(input_array);
168 0 6 if ((error = merge_bases_many(&result, &walk, repo, length, input_array)) < 0)
174 6 6 while (list) {
175 6 0 git_oid *id = git_array_alloc(array);
6 0 git_oid *id = git_array_alloc(array);
176 0 6 if (id == NULL) {
200 0 0 GIT_ASSERT_ARG(out);
201 0 0 GIT_ASSERT_ARG(repo);
202 0 0 GIT_ASSERT_ARG(input_array);
204 0 0 if (length < 2) {
210 0 0 for (i = 1; i < length; i++) {
212 0 0 if (error < 0)
229 0 0 if (git_revwalk_new(&walk, repo) < 0)
233 0 0 if (commit == NULL)
243 0 0 if (commit == NULL)
246 0 0 if (git_merge__bases_many(&result, walk, commit, &list, 0) < 0)
249 0 0 if (!result) {
272 0 0 if ((error = merge_bases(&result, &walk, repo, one, two)) < 0)
291 0 0 if ((error = merge_bases(&result, &walk, repo, one, two)) < 0)
295 0 0 while (list) {
296 0 0 git_oid *id = git_array_alloc(array);
0 0 git_oid *id = git_array_alloc(array);
297 0 0 if (id == NULL)
320 164 39 for (i = 0; i < git_pqueue_size(list); i++) {
322 155 9 if ((commit->flags & STALE) == 0)
332 0 0 while (commit) {
335 0 0 if (!(mark & commit->flags))
340 0 0 for (i = 1; i < commit->out_degree; i++) {
342 0 0 if (git_commit_list_insert(p, plist) == NULL)
346 0 0 commit = commit->out_degree ? commit->parents[0] : NULL;
358 0 0 git_vector_foreach(commits, i, c) {
359 0 0 if (git_commit_list_insert(c, &list) == NULL)
363 0 0 while (list)
364 0 0 if (clear_commit_marks_1(&list, git_commit_list_pop(&list), mark) < 0)
372 0 0 if (git_commit_list_insert(commit, &list) == NULL)
374 0 0 while (list)
375 0 0 if (clear_commit_marks_1(&list, git_commit_list_pop(&list), mark) < 0)
394 0 39 if (git_pqueue_init(&list, 0, twos->length * 2, git_commit_list_generation_cmp) < 0)
398 0 39 if (git_pqueue_insert(&list, one) < 0)
401 39 39 git_vector_foreach(twos, i, two) {
402 0 39 if (git_commit_list_parse(walk, two) < 0)
406 0 39 if (git_pqueue_insert(&list, two) < 0)
411 155 39 while (interesting(&list)) {
415 0 155 if (commit == NULL)
419 62 93 if (flags == (PARENT1 | PARENT2)) {
420 39 23 if (!(commit->flags & RESULT)) {
422 0 39 if (git_commit_list_insert(commit, &result) == NULL)
429 97 155 for (i = 0; i < commit->out_degree; i++) {
431 14 83 if ((p->flags & flags) == flags)
433 0 83 if (p->generation < minimum_generation)
436 0 83 if ((error = git_commit_list_parse(walk, p)) < 0)
440 0 83 if (git_pqueue_insert(&list, p) < 0)
459 0 0 GIT_ERROR_CHECK_ALLOC(redundant);
461 0 0 GIT_ERROR_CHECK_ALLOC(filled_index);
463 0 0 for (i = 0; i < commits->length; ++i) {
464 0 0 if ((error = git_commit_list_parse(walk, commits->contents[i])) < 0)
468 0 0 for (i = 0; i < commits->length; ++i) {
472 0 0 if (redundant[i])
477 0 0 for (j = 0; j < commits->length; j++) {
478 0 0 if (i == j || redundant[j])
0 0 if (i == j || redundant[j])
482 0 0 if ((error = git_vector_insert(&work, commits->contents[j])) < 0)
487 0 0 if (error < 0)
490 0 0 if (commit->flags & PARENT2)
493 0 0 for (j = 0; j < work.length; j++) {
495 0 0 if (w->flags & PARENT1)
501 0 0 if ((error = clear_commit_marks(commit, ALL_FLAGS)) < 0 ||
0 0 if ((error = clear_commit_marks(commit, ALL_FLAGS)) < 0 ||
506 0 0 for (i = 0; i < commits->length; ++i) {
507 0 0 if (redundant[i])
531 0 40 if (twos->length == 0) {
537 40 40 git_vector_foreach(twos, i, two) {
538 0 40 if (one == two)
539 0 0 return git_commit_list_insert(one, out) ? 0 : -1;
542 1 39 if (git_commit_list_parse(walk, one) < 0)
546 0 39 if (error < 0)
553 39 39 while (tmp) {
555 39 0 if (!(c->flags & STALE))
556 0 39 if (git_commit_list_insert_by_date(c, &result) == NULL)
564 39 0 if (result && result->next) {
0 39 if (result && result->next) {
567 0 0 while (result)
570 0 0 if ((error = clear_commit_marks(one, ALL_FLAGS)) < 0 ||
0 0 if ((error = clear_commit_marks(one, ALL_FLAGS)) < 0 ||
571 0 0 (error = clear_commit_marks_many(twos, ALL_FLAGS)) < 0 ||
577 0 0 git_vector_foreach(&redundant, i, two) {
578 0 0 if (two != NULL)
600 0 0 GIT_ASSERT_ARG(repo);
601 0 0 GIT_ASSERT_ARG(cb);
603 0 0 if ((error = git_str_joinpath(&merge_head_path, repo->gitdir,
607 0 0 if ((error = git_futils_readbuffer(&merge_head_file,
613 0 0 while ((line = git__strsep(&buffer, "\n")) != NULL) {
614 0 0 if (strlen(line) != GIT_OID_HEXSZ) {
620 0 0 if ((error = git_oid_fromstr(&oid, line)) < 0)
623 0 0 if ((error = cb(&oid, payload)) != 0) {
631 0 0 if (*buffer) {
648 1 88 if (a->path == NULL)
651 88 0 if ((value = a->mode - b->mode) == 0 &&
64 24 if ((value = a->mode - b->mode) == 0 &&
670 0 22 GIT_ASSERT_ARG(resolved);
671 0 22 GIT_ASSERT_ARG(diff_list);
672 0 22 GIT_ASSERT_ARG(conflict);
676 22 0 if (conflict->type == GIT_MERGE_DIFF_DIRECTORY_FILE ||
0 22 if (conflict->type == GIT_MERGE_DIFF_DIRECTORY_FILE ||
680 22 0 if (conflict->our_status == GIT_DELTA_RENAMED ||
0 22 if (conflict->our_status == GIT_DELTA_RENAMED ||
689 8 14 ours_theirs_differ = ours_changed && theirs_changed &&
716 8 14 if (ours_changed && !ours_empty && !ours_theirs_differ)
7 1 if (ours_changed && !ours_empty && !ours_theirs_differ)
1 6 if (ours_changed && !ours_empty && !ours_theirs_differ)
719 7 14 else if (ours_changed && ours_empty && theirs_empty)
1 6 else if (ours_changed && ours_empty && theirs_empty)
0 1 else if (ours_changed && ours_empty && theirs_empty)
722 4 17 else if (ours_empty && !theirs_changed)
0 4 else if (ours_empty && !theirs_changed)
725 14 7 else if (!ours_changed && theirs_empty)
0 14 else if (!ours_changed && theirs_empty)
728 7 14 else if (ours_changed && !theirs_changed)
0 7 else if (ours_changed && !theirs_changed)
731 14 7 else if (!ours_changed && theirs_changed)
14 0 else if (!ours_changed && theirs_changed)
736 15 7 if (result != NULL &&
15 0 if (result != NULL &&
737 15 0 GIT_MERGE_INDEX_ENTRY_EXISTS(*result) &&
755 0 7 GIT_ASSERT_ARG(resolved);
756 0 7 GIT_ASSERT_ARG(diff_list);
757 0 7 GIT_ASSERT_ARG(conflict);
761 7 0 if (conflict->type == GIT_MERGE_DIFF_DIRECTORY_FILE ||
0 7 if (conflict->type == GIT_MERGE_DIFF_DIRECTORY_FILE ||
772 7 0 if (ours_changed && ours_empty && theirs_empty)
1 6 if (ours_changed && ours_empty && theirs_empty)
0 1 if (ours_changed && ours_empty && theirs_empty)
775 1 6 else if (ours_empty && !theirs_changed)
0 1 else if (ours_empty && !theirs_changed)
778 0 7 else if (!ours_changed && theirs_empty)
0 0 else if (!ours_changed && theirs_empty)
781 0 7 if (*resolved)
797 0 7 GIT_ASSERT_ARG(resolved);
798 0 7 GIT_ASSERT_ARG(diff_list);
799 0 7 GIT_ASSERT_ARG(conflict);
803 6 1 if (!GIT_MERGE_INDEX_ENTRY_EXISTS(conflict->our_entry) ||
0 6 if (!GIT_MERGE_INDEX_ENTRY_EXISTS(conflict->our_entry) ||
810 6 0 if (!ours_renamed && !theirs_renamed)
6 0 if (!ours_renamed && !theirs_renamed)
814 0 0 if (conflict->type == GIT_MERGE_DIFF_BOTH_RENAMED_2_TO_1 ||
0 0 if (conflict->type == GIT_MERGE_DIFF_BOTH_RENAMED_2_TO_1 ||
815 0 0 conflict->type == GIT_MERGE_DIFF_BOTH_RENAMED_1_TO_2 ||
819 0 0 ours_changed = (git_oid__cmp(&conflict->ancestor_entry.id, &conflict->our_entry.id) != 0) ||
0 0 ours_changed = (git_oid__cmp(&conflict->ancestor_entry.id, &conflict->our_entry.id) != 0) ||
822 0 0 theirs_changed = (git_oid__cmp(&conflict->ancestor_entry.id, &conflict->their_entry.id) != 0) ||
0 0 theirs_changed = (git_oid__cmp(&conflict->ancestor_entry.id, &conflict->their_entry.id) != 0) ||
826 0 0 if (ours_changed && theirs_changed &&
830 0 0 if ((merged = git_pool_malloc(&diff_list->pool, sizeof(git_index_entry))) == NULL)
833 0 0 if (ours_changed)
838 0 0 if (ours_renamed)
854 6 1 if (!GIT_MERGE_INDEX_ENTRY_EXISTS(conflict->our_entry) ||
0 6 if (!GIT_MERGE_INDEX_ENTRY_EXISTS(conflict->our_entry) ||
859 0 6 if (conflict->type == GIT_MERGE_DIFF_DIRECTORY_FILE)
863 6 0 if (S_ISGITLINK(conflict->ancestor_entry.mode) ||
6 0 if (S_ISGITLINK(conflict->ancestor_entry.mode) ||
864 0 6 S_ISGITLINK(conflict->our_entry.mode) ||
869 6 0 if ((S_ISLNK(conflict->ancestor_entry.mode) ^
870 0 6 S_ISLNK(conflict->our_entry.mode)) ||
876 6 0 if (conflict->type == GIT_MERGE_DIFF_BOTH_RENAMED_2_TO_1 ||
0 6 if (conflict->type == GIT_MERGE_DIFF_BOTH_RENAMED_2_TO_1 ||
880 0 6 if ((conflict->our_status & GIT_DELTA_RENAMED) == GIT_DELTA_RENAMED &&
0 0 if ((conflict->our_status & GIT_DELTA_RENAMED) == GIT_DELTA_RENAMED &&
881 0 0 (conflict->their_status & GIT_DELTA_RENAMED) == GIT_DELTA_RENAMED &&
905 2 4 if ((error = driver->apply(driver, &path, &mode, &buf, name, src)) < 0 ||
2 0 if ((error = driver->apply(driver, &path, &mode, &buf, name, src)) < 0 ||
906 2 0 (error = git_repository_odb(&odb, src->repo)) < 0 ||
911 0 2 GIT_ERROR_CHECK_ALLOC(result);
918 0 2 GIT_ERROR_CHECK_ALLOC(result->path);
946 0 7 GIT_ASSERT_ARG(resolved);
947 0 7 GIT_ASSERT_ARG(diff_list);
948 0 7 GIT_ASSERT_ARG(conflict);
952 1 6 if (!merge_conflict_can_resolve_contents(conflict))
959 6 0 &conflict->ancestor_entry : NULL;
961 6 0 &conflict->our_entry : NULL;
963 6 0 &conflict->their_entry : NULL;
965 2 4 if (file_opts->favor != GIT_MERGE_FILE_FAVOR_NORMAL) {
977 0 4 if ((error = git_merge_driver_for_source(&name, &driver, &source)) < 0)
980 0 4 if (driver == NULL)
984 6 0 if (driver) {
988 0 6 if (error == GIT_PASSTHROUGH)
992 0 6 if (fallback) {
997 4 2 if (error < 0) {
998 4 0 if (error == GIT_EMERGECONFLICT)
1028 0 22 if ((error = merge_conflict_resolve_trivial(
1032 7 15 if (!resolved && (error = merge_conflict_resolve_one_removed(
0 7 if (!resolved && (error = merge_conflict_resolve_one_removed(
1036 7 15 if (!resolved && (error = merge_conflict_resolve_one_renamed(
0 7 if (!resolved && (error = merge_conflict_resolve_one_renamed(
1040 7 15 if (!resolved && (error = merge_conflict_resolve_contents(
0 7 if (!resolved && (error = merge_conflict_resolve_contents(
1068 0 0 if (*out || *out == &cache_invalid_marker)
0 0 if (*out || *out == &cache_invalid_marker)
1073 0 0 if ((error = git_blob_lookup(&blob, repo, &entry->id)) < 0)
1085 0 0 if (!git__is_sizet(blobsize))
1091 0 0 if (error == GIT_EBUFS)
1111 0 0 if (!GIT_MODE_ISBLOB(a->mode) || !GIT_MODE_ISBLOB(b->mode))
0 0 if (!GIT_MODE_ISBLOB(a->mode) || !GIT_MODE_ISBLOB(b->mode))
1115 0 0 if ((error = index_entry_similarity_calc(&cache[a_idx], repo, a, opts)) < 0 ||
0 0 if ((error = index_entry_similarity_calc(&cache[a_idx], repo, a, opts)) < 0 ||
1120 0 0 if (cache[a_idx] == &cache_invalid_marker || cache[b_idx] == &cache_invalid_marker)
0 0 if (cache[a_idx] == &cache_invalid_marker || cache[b_idx] == &cache_invalid_marker)
1124 0 0 if (opts->metric->similarity(&score, cache[a_idx], cache[b_idx], opts->metric->payload) < 0)
1128 0 0 if (score < 0)
1130 0 0 else if (score > 100)
1148 0 44 if (!map)
1151 1 44 git_oidmap_foreach_value(map, queue, {
1162 1 0 if ((queue = git_oidmap_get(map, id)) == NULL) {
1164 0 1 GIT_ERROR_CHECK_ALLOC(queue);
1170 0 1 if (git_oidmap_set(map, id, queue) < 0)
1173 0 0 array_entry = git_array_alloc(queue->arr);
0 0 array_entry = git_array_alloc(queue->arr);
1174 0 0 GIT_ERROR_CHECK_ALLOC(array_entry);
1186 3 0 if ((queue = git_oidmap_get(map, id)) == NULL)
1189 0 0 if (queue->next_pos == 0) {
1192 0 0 array_entry = git_array_get(queue->arr, queue->next_pos - 1);
1193 0 0 if (array_entry == NULL)
1220 22 22 git_vector_foreach(&diff_list->conflicts, i, conflict_src) {
1223 3 19 if (!GIT_MERGE_INDEX_ENTRY_EXISTS(conflict_src->ancestor_entry))
1226 1 18 if (!GIT_MERGE_INDEX_ENTRY_EXISTS(conflict_src->our_entry)) {
1228 0 1 if (error < 0)
1232 0 19 if (!GIT_MERGE_INDEX_ENTRY_EXISTS(conflict_src->their_entry)) {
1234 0 0 if (error < 0)
1239 22 22 git_vector_foreach(&diff_list->conflicts, j, conflict_tgt) {
1240 19 3 if (GIT_MERGE_INDEX_ENTRY_EXISTS(conflict_tgt->ancestor_entry))
1243 0 3 if (GIT_MERGE_INDEX_ENTRY_EXISTS(conflict_tgt->our_entry)) {
1244 0 0 if (deletes_by_oid_dequeue(&i, ours_deletes_by_oid, &conflict_tgt->our_entry.id) == 0) {
1253 3 0 if (GIT_MERGE_INDEX_ENTRY_EXISTS(conflict_tgt->their_entry)) {
1254 0 3 if (deletes_by_oid_dequeue(&i, theirs_deletes_by_oid, &conflict_tgt->their_entry.id) == 0) {
1283 22 22 git_vector_foreach(&diff_list->conflicts, i, conflict_src) {
1286 19 3 if (!GIT_MERGE_INDEX_ENTRY_EXISTS(conflict_src->ancestor_entry) ||
18 1 if (!GIT_MERGE_INDEX_ENTRY_EXISTS(conflict_src->ancestor_entry) ||
1287 18 0 (GIT_MERGE_INDEX_ENTRY_EXISTS(conflict_src->our_entry) &&
1291 1 1 git_vector_foreach(&diff_list->conflicts, j, conflict_tgt) {
1295 1 0 if (GIT_MERGE_INDEX_ENTRY_EXISTS(conflict_tgt->ancestor_entry))
1298 0 0 if (GIT_MERGE_INDEX_ENTRY_EXISTS(conflict_tgt->our_entry) &&
0 0 if (GIT_MERGE_INDEX_ENTRY_EXISTS(conflict_tgt->our_entry) &&
1302 0 0 if (similarity == GIT_EBUFS)
1304 0 0 else if (similarity < 0)
1307 0 0 if (similarity > similarity_ours[i].similarity &&
0 0 if (similarity > similarity_ours[i].similarity &&
1310 0 0 if (similarity_ours[i].similarity > 0)
1313 0 0 if (similarity_ours[j].similarity > 0)
1324 0 0 if (GIT_MERGE_INDEX_ENTRY_EXISTS(conflict_tgt->their_entry) &&
0 0 if (GIT_MERGE_INDEX_ENTRY_EXISTS(conflict_tgt->their_entry) &&
1328 0 0 if (similarity > similarity_theirs[i].similarity &&
0 0 if (similarity > similarity_theirs[i].similarity &&
1331 0 0 if (similarity_theirs[i].similarity > 0)
1334 0 0 if (similarity_theirs[j].similarity > 0)
1382 0 22 if (ours_renamed)
1385 0 22 if (theirs_renamed)
1389 0 22 if (ours_renamed && theirs_renamed) {
0 0 if (ours_renamed && theirs_renamed) {
1391 0 0 if (ours_source_idx == theirs_source_idx)
1397 0 22 } else if (ours_renamed) {
1399 0 0 if (similarity_theirs[ours_source_idx].similarity >= opts->rename_threshold)
1402 0 0 else if (GIT_MERGE_INDEX_ENTRY_EXISTS(target->their_entry)) {
1407 0 0 else if (!GIT_MERGE_INDEX_ENTRY_EXISTS(ours_source->their_entry))
1410 0 0 else if (ours_source->type == GIT_MERGE_DIFF_MODIFIED_DELETED)
1412 0 22 } else if (theirs_renamed) {
1414 0 0 if (similarity_ours[theirs_source_idx].similarity >= opts->rename_threshold)
1417 0 0 else if (GIT_MERGE_INDEX_ENTRY_EXISTS(target->our_entry)) {
1422 0 0 else if (!GIT_MERGE_INDEX_ENTRY_EXISTS(theirs_source->our_entry))
1425 0 0 else if (theirs_source->type == GIT_MERGE_DIFF_MODIFIED_DELETED)
1455 22 22 for (i = 0; i < diff_list->conflicts.length; i++) {
1461 18 4 if (GIT_MERGE_INDEX_ENTRY_EXISTS(target->our_entry) &&
0 18 if (GIT_MERGE_INDEX_ENTRY_EXISTS(target->our_entry) &&
1480 22 0 if (GIT_MERGE_INDEX_ENTRY_EXISTS(target->their_entry) &&
0 22 if (GIT_MERGE_INDEX_ENTRY_EXISTS(target->their_entry) &&
1511 3 0 return (!GIT_MERGE_INDEX_ENTRY_EXISTS(conflict->ancestor_entry) &&
1512 3 19 !GIT_MERGE_INDEX_ENTRY_EXISTS(conflict->our_entry) &&
0 3 !GIT_MERGE_INDEX_ENTRY_EXISTS(conflict->our_entry) &&
1527 22 22 git_vector_foreach(&diff_list->conflicts, i, entry) {
1528 19 3 if (GIT_MERGE_INDEX_ENTRY_EXISTS(entry->ancestor_entry) &&
18 1 if (GIT_MERGE_INDEX_ENTRY_EXISTS(entry->ancestor_entry) &&
1529 0 18 (!GIT_MERGE_INDEX_ENTRY_EXISTS(entry->our_entry) ||
1532 3 18 else if (!GIT_MERGE_INDEX_ENTRY_EXISTS(entry->ancestor_entry))
1548 0 22 GIT_ASSERT_ARG(diff_list);
1549 0 22 GIT_ASSERT_ARG(opts);
1551 22 0 if ((opts->flags & GIT_MERGE_FIND_RENAMES) == 0 ||
0 22 if ((opts->flags & GIT_MERGE_FIND_RENAMES) == 0 ||
1557 0 22 GIT_ERROR_CHECK_ALLOC(similarity_ours);
1561 0 22 GIT_ERROR_CHECK_ALLOC(similarity_theirs);
1566 0 22 if ((error = merge_diff_mark_similarity_exact(diff_list, similarity_ours, similarity_theirs)) < 0)
1569 22 0 if (opts->rename_threshold < 100 && diff_list->conflicts.length <= opts->target_limit) {
22 0 if (opts->rename_threshold < 100 && diff_list->conflicts.length <= opts->target_limit) {
1570 0 22 GIT_ERROR_CHECK_ALLOC_MULTIPLY(&cache_size, diff_list->conflicts.length, 3);
0 22 GIT_ERROR_CHECK_ALLOC_MULTIPLY(&cache_size, diff_list->conflicts.length, 3);
1572 0 22 GIT_ERROR_CHECK_ALLOC(cache);
1576 22 0 if (src_count > opts->target_limit || tgt_count > opts->target_limit) {
22 0 if (src_count > opts->target_limit || tgt_count > opts->target_limit) {
1579 0 22 if ((error = merge_diff_mark_similarity_inexact(
1594 22 0 if (cache != NULL) {
1595 66 22 for (i = 0; i < cache_size; ++i) {
1596 0 66 if (cache[i] != NULL && cache[i] != &cache_invalid_marker)
0 0 if (cache[i] != NULL && cache[i] != &cache_invalid_marker)
1614 19 3 if (GIT_MERGE_INDEX_ENTRY_EXISTS(conflict->ancestor_entry))
1616 0 3 else if (GIT_MERGE_INDEX_ENTRY_EXISTS(conflict->our_entry))
1618 3 0 else if (GIT_MERGE_INDEX_ENTRY_EXISTS(conflict->their_entry))
1627 0 0 if (conflict->our_status == GIT_DELTA_ADDED ||
0 0 if (conflict->our_status == GIT_DELTA_ADDED ||
1628 0 0 conflict->our_status == GIT_DELTA_MODIFIED ||
1629 0 0 conflict->their_status == GIT_DELTA_ADDED ||
1641 0 0 if (child_len < parent_len ||
0 0 if (child_len < parent_len ||
1658 0 22 else if(df_data->df_path)
1661 0 0 merge_diff_any_side_added_or_modified(df_data->prev_conflict) &&
1662 0 0 merge_diff_any_side_added_or_modified(conflict) &&
1681 0 22 if (conflict->our_status == GIT_DELTA_ADDED &&
0 0 if (conflict->our_status == GIT_DELTA_ADDED &&
1684 7 15 else if (conflict->our_status == GIT_DELTA_MODIFIED &&
7 0 else if (conflict->our_status == GIT_DELTA_MODIFIED &&
1687 1 14 else if (conflict->our_status == GIT_DELTA_DELETED &&
0 1 else if (conflict->our_status == GIT_DELTA_DELETED &&
1690 0 15 else if (conflict->our_status == GIT_DELTA_MODIFIED &&
0 0 else if (conflict->our_status == GIT_DELTA_MODIFIED &&
1693 1 14 else if (conflict->our_status == GIT_DELTA_DELETED &&
1 0 else if (conflict->our_status == GIT_DELTA_DELETED &&
1707 85 7 if (src != NULL) {
1709 0 85 if ((out->path = git_pool_strdup(pool, src->path)) == NULL)
1720 6 38 if (ancestor == NULL && other == NULL)
3 3 if (ancestor == NULL && other == NULL)
1722 3 38 else if (ancestor == NULL && other != NULL)
3 0 else if (ancestor == NULL && other != NULL)
1724 38 0 else if (ancestor != NULL && other == NULL)
1 37 else if (ancestor != NULL && other == NULL)
1726 0 37 else if (S_ISDIR(ancestor->mode) ^ S_ISDIR(other->mode))
1728 0 37 else if(S_ISLNK(ancestor->mode) ^ S_ISLNK(other->mode))
1730 11 26 else if (git_oid__cmp(&ancestor->id, &other->id) ||
0 11 else if (git_oid__cmp(&ancestor->id, &other->id) ||
1744 0 22 if ((conflict = git_pool_mallocz(pool, sizeof(git_merge_diff))) == NULL)
1748 0 22 index_entry_dup_pool(&conflict->our_entry, pool, entries[TREE_IDX_OURS]) < 0 ||
1770 22 0 merge_diff_detect_type(conflict) < 0 ||
1771 0 22 merge_diff_detect_df_conflict(merge_df_data, conflict) < 0 ||
1786 0 26 GIT_ERROR_CHECK_ALLOC(entry);
1788 26 0 if ((error = index_entry_dup_pool(entry, &diff_list->pool, tree_items[0])) >= 0)
1805 45 3 if (!entries[0] || !entries[1] || !entries[2]) {
44 1 if (!entries[0] || !entries[1] || !entries[2]) {
0 44 if (!entries[0] || !entries[1] || !entries[2]) {
1808 81 26 for (i = 1; i < 3; i++) {
1809 18 63 if (index_entry_cmp(entries[0], entries[i]) != 0) {
1818 22 26 find_data->diff_list, &find_data->df_data, entries) :
1838 0 22 if (diff_list == NULL)
1845 22 0 git_vector_init(&diff_list->staged, 0, NULL) < 0 ||
1846 0 22 git_vector_init(&diff_list->conflicts, 0, NULL) < 0 ||
1857 0 22 if (!diff_list)
1876 0 22 GIT_ASSERT_ARG(repo);
1877 0 22 GIT_ASSERT_ARG(opts);
1879 0 22 if ((error = git_repository_config__weakptr(&cfg, repo)) < 0)
1882 18 4 if (given != NULL) {
1889 22 0 if ((opts->flags & GIT_MERGE_FIND_RENAMES) && !opts->rename_threshold)
21 1 if ((opts->flags & GIT_MERGE_FIND_RENAMES) && !opts->rename_threshold)
1892 18 4 if (given && given->default_driver) {
0 18 if (given && given->default_driver) {
1894 0 0 GIT_ERROR_CHECK_ALLOC(opts->default_driver);
1898 0 22 if (error == 0) {
1900 0 0 GIT_ERROR_CHECK_ALLOC(opts->default_driver);
1901 22 0 } else if (error == GIT_ENOTFOUND) {
1908 21 1 if (!opts->target_limit) {
1911 21 0 if (!limit)
1915 0 21 GIT_MERGE_DEFAULT_TARGET_LIMIT : (unsigned int)limit;
1919 22 0 if (!opts->metric) {
1921 0 22 GIT_ERROR_CHECK_ALLOC(opts->metric);
1946 0 6 if (!GIT_MERGE_INDEX_ENTRY_EXISTS(*entry))
1949 4 2 if ((reuc = git_index_reuc_get_bypath(index, entry->path)) != NULL) {
1950 12 4 for (i = 0; i < 3; i++) {
1971 2 22 git_vector_foreach(&diff_list->resolved, i, conflict) {
1974 2 0 &conflict->ancestor_entry : NULL;
1978 2 0 &conflict->our_entry : NULL;
1982 2 0 &conflict->their_entry : NULL;
1984 2 0 if (ancestor != NULL &&
0 2 if (ancestor != NULL &&
1988 2 0 if (ours != NULL &&
0 2 if (ours != NULL &&
1992 2 0 if (theirs != NULL &&
0 2 if (theirs != NULL &&
2010 0 22 if ((error = git_index_new(&index)) < 0)
2013 0 22 if ((error = git_index__fill(index, &diff_list->staged)) < 0)
2016 5 22 git_vector_foreach(&diff_list->conflicts, i, conflict) {
2019 5 0 &conflict->ancestor_entry : NULL;
2023 4 1 &conflict->our_entry : NULL;
2027 5 0 &conflict->their_entry : NULL;
2029 0 5 if ((error = git_index_conflict_add(index, ancestor, ours, theirs)) < 0)
2034 5 22 git_vector_foreach(&diff_list->conflicts, i, conflict) {
2037 0 5 if (!GIT_MERGE_INDEX_ENTRY_EXISTS(conflict->ancestor_entry))
2044 4 1 conflict->our_entry.path : NULL;
2048 5 0 conflict->their_entry.path : NULL;
2050 4 1 if ((our_path && strcmp(ancestor_path, our_path) != 0) ||
4 0 if ((our_path && strcmp(ancestor_path, our_path) != 0) ||
5 0 if ((our_path && strcmp(ancestor_path, our_path) != 0) ||
2051 0 5 (their_path && strcmp(ancestor_path, their_path) != 0)) {
2052 0 0 if ((error = git_index_name_add(index, ancestor_path, our_path, their_path)) < 0)
2057 22 0 if (!skip_reuc) {
2058 0 22 if ((error = index_update_reuc(index, diff_list)) < 0)
2074 66 0 if (given)
2079 0 0 if (git_iterator_for_nothing(empty, &opts) < 0)
2104 0 22 GIT_ASSERT_ARG(out);
2105 0 22 GIT_ASSERT_ARG(repo);
2109 0 22 GIT_ERROR_CHECK_VERSION(
2112 0 22 if ((error = merge_normalize_opts(repo, &opts, given_opts)) < 0)
2119 0 22 if (opts.flags & GIT_MERGE_VIRTUAL_BASE) {
2128 0 22 GIT_ERROR_CHECK_ALLOC(diff_list);
2134 22 0 if ((error = git_merge_diff_list__find_differences(
2135 22 0 diff_list, ancestor_iter, our_iter, theirs_iter)) < 0 ||
2142 22 22 git_vector_foreach(&changes, i, conflict) {
2145 0 22 if ((error = merge_conflict_resolve(
2149 5 17 if (!resolved) {
2150 0 5 if ((opts.flags & GIT_MERGE_FAIL_ON_CONFLICT)) {
2164 18 4 if (!given_opts || !given_opts->metric)
18 0 if (!given_opts || !given_opts->metric)
2189 0 12 GIT_ASSERT_ARG(out);
2190 0 12 GIT_ASSERT_ARG(repo);
2193 12 0 if (ancestor_tree && merge_opts && (merge_opts->flags & GIT_MERGE_SKIP_REUC)) {
12 0 if (ancestor_tree && merge_opts && (merge_opts->flags & GIT_MERGE_SKIP_REUC)) {
0 12 if (ancestor_tree && merge_opts && (merge_opts->flags & GIT_MERGE_SKIP_REUC)) {
2197 0 0 if (our_tree && !git_oid_cmp(ancestor_tree_id, git_tree_id(our_tree)))
0 0 if (our_tree && !git_oid_cmp(ancestor_tree_id, git_tree_id(our_tree)))
2199 0 0 else if (their_tree && !git_oid_cmp(ancestor_tree_id, git_tree_id(their_tree)))
0 0 else if (their_tree && !git_oid_cmp(ancestor_tree_id, git_tree_id(their_tree)))
2202 0 0 if (result) {
2203 0 0 if ((error = git_index_new(out)) == 0)
2212 12 0 if ((error = git_iterator_for_tree(
2213 12 0 &ancestor_iter, (git_tree *)ancestor_tree, &iter_opts)) < 0 ||
2215 12 0 &our_iter, (git_tree *)our_tree, &iter_opts)) < 0 ||
2247 12 0 if (annotated_commit->type == GIT_ANNOTATED_COMMIT_REAL) {
2248 6 6 id = git_array_alloc(*ids);
6 0 id = git_array_alloc(*ids);
2249 0 12 GIT_ERROR_CHECK_ALLOC(id);
2253 0 0 for (i = 0; i < annotated_commit->parents.size; i++) {
2254 0 0 id = git_array_alloc(*ids);
0 0 id = git_array_alloc(*ids);
2255 0 0 GIT_ERROR_CHECK_ALLOC(id);
2279 0 0 if (opts)
2285 0 0 if ((merge_annotated_commits(&index, NULL, repo, one, two,
2290 0 0 GIT_ERROR_CHECK_ALLOC(result);
2321 6 0 if (given_opts)
2330 6 0 if ((error = insert_head_ids(&head_ids, two)) < 0 ||
6 0 if ((error = insert_head_ids(&head_ids, two)) < 0 ||
2331 6 0 (error = insert_head_ids(&head_ids, one)) < 0 ||
2336 6 0 base_count = (opts.flags & GIT_MERGE_NO_RECURSIVE) ? 0 : bases.count;
2338 6 0 if (base_count)
2341 0 6 if ((error = git_annotated_commit_lookup(&base, repo, &bases.ids[0])) < 0)
2344 0 6 for (i = 1; i < base_count; i++) {
2347 0 0 if (opts.recursion_limit && recursion_level > opts.recursion_limit)
0 0 if (opts.recursion_limit && recursion_level > opts.recursion_limit)
2350 0 0 if ((error = git_annotated_commit_lookup(&other, repo,
2351 0 0 &bases.ids[i])) < 0 ||
2365 6 0 if (error == 0)
2386 0 18 if (commit == NULL) {
2388 0 18 } else if (commit->type == GIT_ANNOTATED_COMMIT_VIRTUAL) {
2391 18 0 if (!commit->tree &&
0 18 if (!commit->tree &&
2415 0 6 if ((error = compute_base(&base, repo, ours, theirs, opts,
2418 0 0 if (error != GIT_ENOTFOUND)
2424 6 0 if ((error = iterator_for_annotated_commit(&base_iter, base)) < 0 ||
6 0 if ((error = iterator_for_annotated_commit(&base_iter, base)) < 0 ||
2425 6 0 (error = iterator_for_annotated_commit(&our_iter, ours)) < 0 ||
2426 6 0 (error = iterator_for_annotated_commit(&their_iter, theirs)) < 0 ||
2431 6 0 if (base_out) {
2455 1 0 if ((error = git_annotated_commit_from_commit(&ours, (git_commit *)our_commit)) < 0 ||
1 0 if ((error = git_annotated_commit_from_commit(&ours, (git_commit *)our_commit)) < 0 ||
2480 0 5 GIT_ASSERT_ARG(repo);
2481 0 5 GIT_ASSERT_ARG(heads);
2483 5 0 if ((error = git_str_joinpath(&file_path, repo->gitdir, GIT_MERGE_HEAD_FILE)) < 0 ||
5 0 if ((error = git_str_joinpath(&file_path, repo->gitdir, GIT_MERGE_HEAD_FILE)) < 0 ||
2487 5 5 for (i = 0; i < heads_len; i++) {
2488 0 5 if ((error = git_filebuf_printf(&file, "%s\n", heads[i]->id_str)) < 0)
2495 0 5 if (error < 0)
2509 0 5 GIT_ASSERT_ARG(repo);
2511 5 0 if ((error = git_str_joinpath(&file_path, repo->gitdir, GIT_MERGE_MODE_FILE)) < 0 ||
5 0 if ((error = git_str_joinpath(&file_path, repo->gitdir, GIT_MERGE_MODE_FILE)) < 0 ||
2515 0 5 if ((error = git_filebuf_write(&file, "no-ff", 5)) < 0)
2521 0 5 if (error < 0)
2540 5 0 return (entry->written == 0 &&
2541 5 0 entry->merge_head->remote_url == NULL &&
2542 5 0 entry->merge_head->ref_name != NULL &&
5 0 entry->merge_head->ref_name != NULL &&
2552 0 0 return (entry->written == 0 &&
2553 0 0 entry->merge_head->remote_url == NULL &&
2554 0 5 entry->merge_head->ref_name != NULL &&
0 0 entry->merge_head->ref_name != NULL &&
2564 0 0 return (entry->written == 0 &&
2565 0 0 entry->merge_head->remote_url == NULL &&
2566 0 5 entry->merge_head->ref_name != NULL &&
0 0 entry->merge_head->ref_name != NULL &&
2574 0 5 if (entry->written == 0 &&
0 0 if (entry->written == 0 &&
2575 0 0 entry->merge_head->remote_url != NULL &&
2576 0 0 entry->merge_head->ref_name != NULL &&
2582 0 0 if (entries->length == 0)
2597 0 5 return (merge_msg_entry->written == 0 &&
2598 5 0 merge_msg_entry->merge_head->ref_name == NULL &&
0 0 merge_msg_entry->merge_head->ref_name == NULL &&
2619 20 20 for (i = 0; i < len; i++) {
2620 0 20 if ((matches = match(&entries[i], v)) < 0)
2622 15 5 else if (!matches)
2645 10 5 if (entries->length == 0)
2648 0 5 if (sep && (error = git_filebuf_printf(file, "%c ", sep)) < 0)
0 0 if (sep && (error = git_filebuf_printf(file, "%c ", sep)) < 0)
2651 5 0 if ((error = git_filebuf_printf(file, "%s ",
0 5 if ((error = git_filebuf_printf(file, "%s ",
2655 5 5 git_vector_foreach(entries, i, entry) {
2656 0 5 if (i > 0 &&
0 0 if (i > 0 &&
2657 0 0 (error = git_filebuf_printf(file, "%s", (i == entries->length - 1) ? " and " : ", ")) < 0)
2660 0 5 if ((error = git_filebuf_printf(file, "'%s'", entry->merge_head->ref_name + ref_name_skip)) < 0)
2666 0 5 if (source)
2707 0 0 if (entries->length == 0)
2729 0 5 GIT_ASSERT_ARG(repo);
2730 0 5 GIT_ASSERT_ARG(heads);
2733 0 5 GIT_ERROR_CHECK_ALLOC(entries);
2735 0 5 if (git_vector_init(&matching, heads_len, NULL) < 0) {
2740 5 5 for (i = 0; i < heads_len; i++)
2743 5 0 if ((error = git_str_joinpath(&file_path, repo->gitdir, GIT_MERGE_MSG_FILE)) < 0 ||
5 0 if ((error = git_str_joinpath(&file_path, repo->gitdir, GIT_MERGE_MSG_FILE)) < 0 ||
2744 5 0 (error = git_filebuf_open(&file, file_path.ptr, GIT_FILEBUF_CREATE_LEADING_DIRS, GIT_MERGE_FILE_MODE)) < 0 ||
2759 5 0 for (i = 0; i < heads_len; i++) {
2760 5 0 if (!msg_entry_is_oid(&entries[i]))
2763 0 0 if ((error = git_filebuf_printf(&file,
0 0 if ((error = git_filebuf_printf(&file,
2771 0 5 if (i)
2774 5 0 if ((error = merge_msg_entries(&matching, entries, heads_len, msg_entry_is_branch)) < 0 ||
5 0 if ((error = merge_msg_entries(&matching, entries, heads_len, msg_entry_is_branch)) < 0 ||
2778 5 0 if (matching.length)
2781 5 0 if ((error = merge_msg_entries(&matching, entries, heads_len, msg_entry_is_tracking)) < 0 ||
5 0 if ((error = merge_msg_entries(&matching, entries, heads_len, msg_entry_is_tracking)) < 0 ||
2785 0 5 if (matching.length)
2788 5 0 if ((error = merge_msg_entries(&matching, entries, heads_len, msg_entry_is_tag)) < 0 ||
5 0 if ((error = merge_msg_entries(&matching, entries, heads_len, msg_entry_is_tag)) < 0 ||
2792 0 5 if (matching.length)
2797 0 5 while ((error = merge_msg_entries(&matching, entries, heads_len, msg_entry_is_remote)) > 0) {
2798 0 0 if ((error = merge_msg_write_remotes(&file, &matching, sep)) < 0)
2801 0 0 if (matching.length)
2805 0 5 if (error < 0)
2808 5 5 for (i = 0; i < heads_len; i++) {
2809 5 0 if (merge_msg_entry_written(&entries[i]))
2812 0 0 if ((error = git_filebuf_printf(&file, "; commit '%s'",
2817 5 0 if ((error = git_filebuf_printf(&file, "\n")) < 0 ||
2822 0 5 if (error < 0)
2841 0 5 GIT_ASSERT_ARG(repo);
2842 0 5 GIT_ASSERT_ARG(our_head);
2843 0 5 GIT_ASSERT_ARG(heads);
2845 5 0 if ((error = git_repository__set_orig_head(repo, git_annotated_commit_id(our_head))) == 0 &&
5 0 if ((error = git_repository__set_orig_head(repo, git_annotated_commit_id(our_head))) == 0 &&
2846 5 0 (error = write_merge_head(repo, heads, heads_len)) == 0 &&
2867 0 5 GIT_ASSERT_ARG(repo);
2868 0 5 GIT_ASSERT_ARG(our_head);
2869 0 5 GIT_ASSERT_ARG(their_heads);
2871 0 5 GIT_ERROR_CHECK_ALLOC_ADD(&alloc_len, their_heads_len, 1);
0 5 GIT_ERROR_CHECK_ALLOC_ADD(&alloc_len, their_heads_len, 1);
2873 0 5 GIT_ERROR_CHECK_ALLOC(oids);
2877 5 5 for (i = 0; i < their_heads_len; i++)
2880 0 5 if ((error = git_merge_base_many(&ancestor_oid, repo, their_heads_len + 1, oids)) < 0)
2894 0 5 if ((slash = strrchr(branchname, '/')) == NULL)
2897 0 5 if (*(slash+1) == '\0')
2918 5 0 if (given_checkout_opts != NULL)
2925 5 0 if (!out->ancestor_label) {
2926 5 0 if (ancestor && ancestor->type == GIT_ANNOTATED_COMMIT_REAL)
5 0 if (ancestor && ancestor->type == GIT_ANNOTATED_COMMIT_REAL)
2928 0 0 else if (ancestor)
2934 5 0 if (!out->our_label) {
2935 5 0 if (our_head && our_head->ref_name)
5 0 if (our_head && our_head->ref_name)
2941 5 0 if (!out->their_label) {
2942 5 0 if (their_heads_len == 1 && their_heads[0]->ref_name)
5 0 if (their_heads_len == 1 && their_heads[0]->ref_name)
2944 0 0 else if (their_heads_len == 1)
2975 15 0 if ((error = git_repository_head_tree(&head_tree, repo)) < 0 ||
15 0 if ((error = git_repository_head_tree(&head_tree, repo)) < 0 ||
2976 15 0 (error = git_repository_index(&index_repo, repo)) < 0 ||
2980 12 3 if (staged_diff_list->deltas.length == 0)
2983 3 3 git_vector_foreach(&staged_diff_list->deltas, i, delta) {
2984 0 3 if ((error = git_vector_insert(&staged_paths, (char *)delta->new_file.path)) < 0)
2992 3 0 if ((error = git_iterator_for_index(&iter_repo, repo, index_repo, &iter_opts)) < 0 ||
3 0 if ((error = git_iterator_for_index(&iter_repo, repo, index_repo, &iter_opts)) < 0 ||
2993 3 0 (error = git_iterator_for_index(&iter_new, repo, index_new, &iter_opts)) < 0 ||
3028 2 13 if (merged_paths->length == 0)
3042 0 13 if ((error = git_diff_index_to_workdir(&wd_diff_list, repo, NULL, &opts)) < 0)
3068 15 0 if ((error = git_repository_head_tree(&head_tree, repo)) < 0 ||
15 0 if ((error = git_repository_head_tree(&head_tree, repo)) < 0 ||
3069 15 0 (error = git_iterator_for_tree(&iter_head, head_tree, &iter_opts)) < 0 ||
3070 15 0 (error = git_iterator_for_index(&iter_new, repo, index_new, &iter_opts)) < 0 ||
3074 12 15 git_vector_foreach(&merged_list->deltas, i, delta) {
3075 0 12 if ((error = git_vector_insert(&paths, (char *)delta->new_file.path)) < 0)
3079 39 15 for (i = 0; i < git_index_entrycount(index_new); i++) {
3083 0 10 (git_vector_last(&paths) == NULL ||
3086 0 1 if ((error = git_vector_insert(&paths, (char *)e->path)) < 0)
3092 15 0 if ((error = merge_check_index(&index_conflicts, repo, index_new, &paths)) < 0 ||
15 0 if ((error = merge_check_index(&index_conflicts, repo, index_new, &paths)) < 0 ||
3096 1 14 if ((conflicts = index_conflicts + wd_conflicts) > 0) {
3097 0 1 git_error_set(GIT_ERROR_MERGE, "%" PRIuZ " uncommitted change%s would be overwritten by merge",
3122 8 3 if (!git_index_has_conflicts(index))
3125 3 0 if ((error = git_str_joinpath(&file_path, repo->gitdir, GIT_MERGE_MSG_FILE)) < 0 ||
3 0 if ((error = git_str_joinpath(&file_path, repo->gitdir, GIT_MERGE_MSG_FILE)) < 0 ||
3131 11 3 for (i = 0; i < git_index_entrycount(index); i++) {
3134 2 9 if (!git_index_entry_is_conflict(e))
3137 6 3 if (last == NULL || strcmp(e->path, last) != 0)
0 6 if (last == NULL || strcmp(e->path, last) != 0)
3146 0 3 if (error < 0)
3179 0 5 if ((error = git_annotated_commit_from_ref(&our_head, repo, our_ref)) < 0)
3182 0 5 if ((error = merge_ancestor_head(&ancestor_head, repo, our_head, their_heads, their_heads_len)) < 0) {
3183 0 0 if (error != GIT_ENOTFOUND)
3194 0 5 if (error < 0) {
3210 0 5 if ((error = git_repository_config_snapshot(&config, repo)) < 0)
3213 5 0 if ((error = git_config_get_string(&value, config, "merge.ff")) < 0) {
3214 5 0 if (error == GIT_ENOTFOUND) {
3222 0 0 if (git_config_parse_bool(&bool_value, value) == 0) {
3223 0 0 if (!bool_value)
3226 0 0 if (strcasecmp(value, "only") == 0)
3247 0 5 GIT_ASSERT_ARG(analysis_out);
3248 0 5 GIT_ASSERT_ARG(preference_out);
3249 0 5 GIT_ASSERT_ARG(repo);
3250 5 0 GIT_ASSERT_ARG(their_heads && their_heads_len > 0);
0 5 GIT_ASSERT_ARG(their_heads && their_heads_len > 0);
3252 0 5 if (their_heads_len != 1) {
3260 0 5 if ((error = merge_preference(preference_out, repo)) < 0)
3263 0 5 if ((error = git_reference__is_unborn_head(&unborn, our_ref, repo)) < 0)
3266 0 5 if (unborn) {
3272 0 5 if ((error = merge_heads(&ancestor_head, &our_head, repo, our_ref, their_heads, their_heads_len)) < 0)
3276 5 0 if (ancestor_head && git_oid_equal(
1 4 if (ancestor_head && git_oid_equal(
3281 4 0 else if (ancestor_head && git_oid_equal(
1 3 else if (ancestor_head && git_oid_equal(
3305 0 5 if ((error = git_reference_lookup(&head_ref, repo, GIT_HEAD_FILE)) < 0) {
3332 0 5 GIT_ASSERT_ARG(repo);
3333 5 0 GIT_ASSERT_ARG(their_heads && their_heads_len > 0);
0 5 GIT_ASSERT_ARG(their_heads && their_heads_len > 0);
3335 0 5 if (their_heads_len != 1) {
3340 0 5 if ((error = git_repository__ensure_not_bare(repo, "merge")) < 0)
3344 5 0 given_checkout_opts->checkout_strategy :
3347 0 5 if ((error = git_indexwriter_init_for_operation(&indexwriter, repo,
3356 5 0 if ((error = git_annotated_commit_from_head(&our_head, repo)) < 0 ||
5 0 if ((error = git_annotated_commit_from_head(&our_head, repo)) < 0 ||
3363 5 0 if ((error = merge_annotated_commits(&index, &base, repo, our_head,
3364 5 0 (git_annotated_commit *)their_heads[0], 0, merge_opts)) < 0 ||
3365 5 0 (error = git_merge__check_result(repo, index)) < 0 ||
3371 5 0 if ((error = merge_normalize_checkout_opts(&checkout_opts, repo,
3373 5 0 base, our_head, their_heads, their_heads_len)) < 0 ||
3380 0 5 if (error < 0)
3395 0 0 GIT_INIT_STRUCTURE_FROM_TEMPLATE(
3409 0 0 GIT_INIT_STRUCTURE_FROM_TEMPLATE(
3424 0 0 GIT_INIT_STRUCTURE_FROM_TEMPLATE(