|
9 | 9 | #include "notes.h" |
10 | 10 | #include "notes-merge.h" |
11 | 11 | #include "strbuf.h" |
| 12 | +#include "notes-utils.h" |
12 | 13 |
|
13 | 14 | struct notes_merge_pair { |
14 | 15 | unsigned char obj[20], base[20], local[20], remote[20]; |
@@ -530,32 +531,6 @@ static int merge_from_diffs(struct notes_merge_options *o, |
530 | 531 | return conflicts ? -1 : 1; |
531 | 532 | } |
532 | 533 |
|
533 | | -void create_notes_commit(struct notes_tree *t, struct commit_list *parents, |
534 | | - const struct strbuf *msg, unsigned char *result_sha1) |
535 | | -{ |
536 | | - unsigned char tree_sha1[20]; |
537 | | - |
538 | | - assert(t->initialized); |
539 | | - |
540 | | - if (write_notes_tree(t, tree_sha1)) |
541 | | - die("Failed to write notes tree to database"); |
542 | | - |
543 | | - if (!parents) { |
544 | | - /* Deduce parent commit from t->ref */ |
545 | | - unsigned char parent_sha1[20]; |
546 | | - if (!read_ref(t->ref, parent_sha1)) { |
547 | | - struct commit *parent = lookup_commit(parent_sha1); |
548 | | - if (!parent || parse_commit(parent)) |
549 | | - die("Failed to find/parse commit %s", t->ref); |
550 | | - commit_list_insert(parent, &parents); |
551 | | - } |
552 | | - /* else: t->ref points to nothing, assume root/orphan commit */ |
553 | | - } |
554 | | - |
555 | | - if (commit_tree(msg, tree_sha1, parents, result_sha1, NULL, NULL)) |
556 | | - die("Failed to commit notes tree to database"); |
557 | | -} |
558 | | - |
559 | 534 | int notes_merge(struct notes_merge_options *o, |
560 | 535 | struct notes_tree *local_tree, |
561 | 536 | unsigned char *result_sha1) |
|
0 commit comments