| 1197 | } |
| 1198 | |
| 1199 | void format_trailers_from_commit(const struct process_trailer_options *opts, |
| 1200 | const char *msg, |
| 1201 | struct strbuf *out) |
| 1202 | { |
| 1203 | LIST_HEAD(trailer_objects); |
| 1204 | struct trailer_block *trailer_block = parse_trailers(opts, msg, &trailer_objects); |
| 1205 | |
| 1206 | /* If we want the whole block untouched, we can take the fast path. */ |
| 1207 | if (!opts->only_trailers && !opts->unfold && !opts->filter && |
| 1208 | !opts->separator && !opts->key_only && !opts->value_only && |
| 1209 | !opts->key_value_separator) { |
| 1210 | strbuf_add(out, msg + trailer_block->start, |
| 1211 | trailer_block->end - trailer_block->start); |
| 1212 | } else |
| 1213 | format_trailers(opts, &trailer_objects, out); |
| 1214 | |
| 1215 | free_trailers(&trailer_objects); |
| 1216 | trailer_block_release(trailer_block); |
| 1217 | } |
| 1218 | |
| 1219 | void trailer_iterator_init(struct trailer_iterator *iter, const char *msg) |
| 1220 | { |
no test coverage detected