The only error case is to run out of memory in string-list */
| 10 | |
| 11 | /* The only error case is to run out of memory in string-list */ |
| 12 | void record_resolve_undo(struct index_state *istate, struct cache_entry *ce) |
| 13 | { |
| 14 | struct string_list_item *lost; |
| 15 | struct resolve_undo_info *ui; |
| 16 | struct string_list *resolve_undo; |
| 17 | int stage = ce_stage(ce); |
| 18 | |
| 19 | if (!stage) |
| 20 | return; |
| 21 | |
| 22 | if (!istate->resolve_undo) { |
| 23 | CALLOC_ARRAY(resolve_undo, 1); |
| 24 | resolve_undo->strdup_strings = 1; |
| 25 | istate->resolve_undo = resolve_undo; |
| 26 | } |
| 27 | resolve_undo = istate->resolve_undo; |
| 28 | lost = string_list_insert(resolve_undo, ce->name); |
| 29 | if (!lost->util) |
| 30 | lost->util = xcalloc(1, sizeof(*ui)); |
| 31 | ui = lost->util; |
| 32 | oidcpy(&ui->oid[stage - 1], &ce->oid); |
| 33 | ui->mode[stage - 1] = ce->ce_mode; |
| 34 | } |
| 35 | |
| 36 | void resolve_undo_write(struct strbuf *sb, struct string_list *resolve_undo, |
| 37 | const struct git_hash_algo *algop) |
no test coverage detected