diff options
author | Taylor Blau <me@ttaylorr.com> | 2022-10-24 21:55:41 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-10-25 00:48:05 +0300 |
commit | 10538e2a627b8ab14f977c868f2975a2acb4ed4d (patch) | |
tree | 44001bf8b105e72b881458a26d9b2943b189926e /builtin/shortlog.c | |
parent | 3dc95e09e1355ebde472bd5be37aa7b29ef774d3 (diff) |
shortlog: extract `shortlog_finish_setup()`
Extract a function which finishes setting up the shortlog struct for
use. The caller in `make_cover_letter()` does not care about trailer
sorting, so it isn't strictly necessary to add a call there in this
patch.
But the next patch will add additional functionality to the new
`shortlog_finish_setup()` function, which the caller in
`make_cover_letter()` will care about.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/shortlog.c')
-rw-r--r-- | builtin/shortlog.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/builtin/shortlog.c b/builtin/shortlog.c index f3b237c5ff..808bae9baa 100644 --- a/builtin/shortlog.c +++ b/builtin/shortlog.c @@ -381,6 +381,11 @@ void shortlog_init(struct shortlog *log) log->format.strdup_strings = 1; } +void shortlog_finish_setup(struct shortlog *log) +{ + string_list_sort(&log->trailers); +} + int cmd_shortlog(int argc, const char **argv, const char *prefix) { struct shortlog log = { STRING_LIST_INIT_NODUP }; @@ -450,7 +455,7 @@ parse_done: if (!log.groups) log.groups = SHORTLOG_GROUP_AUTHOR; - string_list_sort(&log.trailers); + shortlog_finish_setup(&log); /* assume HEAD if from a tty */ if (!nongit && !rev.pending.nr && isatty(0)) |