| 1141 | } |
| 1142 | |
| 1143 | int add_note(struct notes_tree *t, const struct object_id *object_oid, |
| 1144 | const struct object_id *note_oid, combine_notes_fn combine_notes) |
| 1145 | { |
| 1146 | struct leaf_node *l; |
| 1147 | |
| 1148 | if (!t) |
| 1149 | t = &default_notes_tree; |
| 1150 | assert(t->initialized); |
| 1151 | t->dirty = 1; |
| 1152 | if (!combine_notes) |
| 1153 | combine_notes = t->combine_notes; |
| 1154 | l = (struct leaf_node *) xmalloc(sizeof(struct leaf_node)); |
| 1155 | oidcpy(&l->key_oid, object_oid); |
| 1156 | oidcpy(&l->val_oid, note_oid); |
| 1157 | return note_tree_insert(t, t->root, 0, l, PTR_TYPE_NOTE, combine_notes); |
| 1158 | } |
| 1159 | |
| 1160 | int remove_note(struct notes_tree *t, const unsigned char *object_sha1) |
| 1161 | { |
no test coverage detected