| 910 | } |
| 911 | |
| 912 | int combine_notes_cat_sort_uniq(struct object_id *cur_oid, |
| 913 | const struct object_id *new_oid) |
| 914 | { |
| 915 | struct string_list sort_uniq_list = STRING_LIST_INIT_DUP; |
| 916 | struct strbuf buf = STRBUF_INIT; |
| 917 | int ret = 1; |
| 918 | |
| 919 | /* read both note blob objects into unique_lines */ |
| 920 | if (string_list_add_note_lines(&sort_uniq_list, cur_oid)) |
| 921 | goto out; |
| 922 | if (string_list_add_note_lines(&sort_uniq_list, new_oid)) |
| 923 | goto out; |
| 924 | string_list_remove_empty_items(&sort_uniq_list, 0); |
| 925 | string_list_sort_u(&sort_uniq_list, 0); |
| 926 | |
| 927 | /* create a new blob object from sort_uniq_list */ |
| 928 | if (for_each_string_list(&sort_uniq_list, |
| 929 | string_list_join_lines_helper, &buf)) |
| 930 | goto out; |
| 931 | |
| 932 | ret = odb_write_object(the_repository->objects, buf.buf, |
| 933 | buf.len, OBJ_BLOB, cur_oid); |
| 934 | |
| 935 | out: |
| 936 | strbuf_release(&buf); |
| 937 | string_list_clear(&sort_uniq_list, 0); |
| 938 | return ret; |
| 939 | } |
| 940 | |
| 941 | static int string_list_add_one_ref(const struct reference *ref, void *cb) |
| 942 | { |
nothing calls this directly
no test coverage detected