mirror of
https://github.com/git-for-windows/git.git
synced 2026-04-28 10:34:31 -05:00
format-patch: refactor generate_commit_list_cover
Refactor for readability and remove unnecessary initialization. Signed-off-by: Mirko Faina <mroik@delayed.space> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
60cb27ed65
commit
3482b42787
@@ -1376,12 +1376,11 @@ static void generate_commit_list_cover(FILE *cover_file, const char *format,
|
||||
struct pretty_print_context ctx = {0};
|
||||
struct rev_info rev = REV_INFO_INIT;
|
||||
|
||||
strbuf_init(&commit_line, 0);
|
||||
rev.total = n;
|
||||
ctx.rev = &rev;
|
||||
for (int i = n - 1; i >= 0; i--) {
|
||||
rev.nr = n - i;
|
||||
repo_format_commit_message(the_repository, list[i], format,
|
||||
for (int i = 1; i <= n; i++) {
|
||||
rev.nr = i;
|
||||
repo_format_commit_message(the_repository, list[n - i], format,
|
||||
&commit_line, &ctx);
|
||||
fprintf(cover_file, "%s\n", commit_line.buf);
|
||||
strbuf_reset(&commit_line);
|
||||
|
||||
Reference in New Issue
Block a user