MCPcopy Index your code
hub / github.com/git/git / combine_notes_cat_sort_uniq

Function combine_notes_cat_sort_uniq

notes.c:912–939  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

910}
911
912int 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
935out:
936 strbuf_release(&buf);
937 string_list_clear(&sort_uniq_list, 0);
938 return ret;
939}
940
941static int string_list_add_one_ref(const struct reference *ref, void *cb)
942{

Callers

nothing calls this directly

Calls 7

string_list_sort_uFunction · 0.85
for_each_string_listFunction · 0.85
odb_write_objectFunction · 0.85
strbuf_releaseFunction · 0.85
string_list_clearFunction · 0.85

Tested by

no test coverage detected