| 239 | } |
| 240 | |
| 241 | void shortlog_add_commit(struct shortlog *log, struct commit *commit) |
| 242 | { |
| 243 | struct strbuf oneline = STRBUF_INIT; |
| 244 | struct strset dups = STRSET_INIT; |
| 245 | struct pretty_print_context ctx = {0}; |
| 246 | const char *oneline_str; |
| 247 | |
| 248 | ctx.fmt = CMIT_FMT_USERFORMAT; |
| 249 | ctx.abbrev = log->abbrev; |
| 250 | ctx.date_mode = log->date_mode; |
| 251 | ctx.output_encoding = get_log_output_encoding(); |
| 252 | |
| 253 | if (!log->summary) { |
| 254 | if (log->user_format) |
| 255 | pretty_print_commit(&ctx, commit, &oneline); |
| 256 | else |
| 257 | repo_format_commit_message(the_repository, commit, |
| 258 | "%s", &oneline, &ctx); |
| 259 | } |
| 260 | oneline_str = oneline.len ? oneline.buf : "<none>"; |
| 261 | |
| 262 | insert_records_from_trailers(log, &dups, commit, &ctx, oneline_str); |
| 263 | insert_records_from_format(log, &dups, commit, &ctx, oneline_str); |
| 264 | |
| 265 | strset_clear(&dups); |
| 266 | strbuf_release(&oneline); |
| 267 | } |
| 268 | |
| 269 | static void get_from_rev(struct rev_info *rev, struct shortlog *log) |
| 270 | { |
no test coverage detected