| 524 | } |
| 525 | |
| 526 | static int merge_from_diffs(struct notes_merge_options *o, |
| 527 | const struct object_id *base, |
| 528 | const struct object_id *local, |
| 529 | const struct object_id *remote, |
| 530 | struct notes_tree *t) |
| 531 | { |
| 532 | struct notes_merge_pair *changes; |
| 533 | int num_changes, conflicts; |
| 534 | |
| 535 | trace_printf("\tmerge_from_diffs(base = %.7s, local = %.7s, " |
| 536 | "remote = %.7s)\n", oid_to_hex(base), oid_to_hex(local), |
| 537 | oid_to_hex(remote)); |
| 538 | |
| 539 | changes = diff_tree_remote(o, base, remote, &num_changes); |
| 540 | diff_tree_local(o, changes, num_changes, base, local); |
| 541 | |
| 542 | conflicts = merge_changes(o, changes, &num_changes, t); |
| 543 | free(changes); |
| 544 | |
| 545 | if (o->verbosity >= 4) |
| 546 | printf(t->dirty ? |
| 547 | "Merge result: %i unmerged notes and a dirty notes tree\n" : |
| 548 | "Merge result: %i unmerged notes and a clean notes tree\n", |
| 549 | conflicts); |
| 550 | |
| 551 | return conflicts ? -1 : 1; |
| 552 | } |
| 553 | |
| 554 | int notes_merge(struct notes_merge_options *o, |
| 555 | struct notes_tree *local_tree, |
no test coverage detected