| 739 | }; |
| 740 | |
| 741 | static int write_each_non_note_until(const char *note_path, |
| 742 | struct write_each_note_data *d) |
| 743 | { |
| 744 | struct non_note *p = d->nn_prev; |
| 745 | struct non_note *n = p ? p->next : *d->nn_list; |
| 746 | int cmp = 0, ret; |
| 747 | while (n && (!note_path || (cmp = strcmp(n->path, note_path)) <= 0)) { |
| 748 | if (note_path && cmp == 0) |
| 749 | ; /* do nothing, prefer note to non-note */ |
| 750 | else { |
| 751 | ret = write_each_note_helper(d->root, n->path, n->mode, |
| 752 | &n->oid); |
| 753 | if (ret) |
| 754 | return ret; |
| 755 | } |
| 756 | p = n; |
| 757 | n = n->next; |
| 758 | } |
| 759 | d->nn_prev = p; |
| 760 | return 0; |
| 761 | } |
| 762 | |
| 763 | static int write_each_note(const struct object_id *object_oid UNUSED, |
| 764 | const struct object_id *note_oid, char *note_path, |
no test coverage detected