| 2252 | } |
| 2253 | |
| 2254 | void pp_remainder(struct pretty_print_context *pp, |
| 2255 | const char **msg_p, |
| 2256 | struct strbuf *sb, |
| 2257 | int indent) |
| 2258 | { |
| 2259 | struct grep_opt *opt = pp->rev ? &pp->rev->grep_filter : NULL; |
| 2260 | int first = 1; |
| 2261 | |
| 2262 | for (;;) { |
| 2263 | const char *line = *msg_p; |
| 2264 | int linelen = get_one_line(line); |
| 2265 | *msg_p += linelen; |
| 2266 | |
| 2267 | if (!linelen) |
| 2268 | break; |
| 2269 | |
| 2270 | if (is_blank_line(line, &linelen)) { |
| 2271 | if (first) |
| 2272 | continue; |
| 2273 | if (pp->fmt == CMIT_FMT_SHORT) |
| 2274 | break; |
| 2275 | } |
| 2276 | first = 0; |
| 2277 | |
| 2278 | strbuf_grow(sb, linelen + indent + 20); |
| 2279 | if (indent) |
| 2280 | pp_handle_indent(pp, sb, indent, line, linelen); |
| 2281 | else if (pp->expand_tabs_in_log) |
| 2282 | strbuf_add_tabexpand(sb, opt, pp->color, |
| 2283 | pp->expand_tabs_in_log, line, |
| 2284 | linelen); |
| 2285 | else { |
| 2286 | if (pp->fmt == CMIT_FMT_MBOXRD && |
| 2287 | is_mboxrd_from(line, linelen)) |
| 2288 | strbuf_addch(sb, '>'); |
| 2289 | |
| 2290 | append_line_with_color(sb, opt, line, linelen, |
| 2291 | pp->color, GREP_CONTEXT_BODY, |
| 2292 | GREP_HEADER_FIELD_MAX); |
| 2293 | } |
| 2294 | strbuf_addch(sb, '\n'); |
| 2295 | } |
| 2296 | } |
| 2297 | |
| 2298 | void pretty_print_commit(struct pretty_print_context *pp, |
| 2299 | const struct commit *commit, |
no test coverage detected