builtin/blame.c: refactor commit_info_init() to COMMIT_INFO_INIT macro
commit4eb2bfdc92139f04619be21a354c025747e7ceea
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Mon, 27 Sep 2021 12:58:42 +0000 (27 14:58 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 Sep 2021 22:02:32 +0000 (27 15:02 -0700)
tree1d7da54e9e512d6c444b9706ea95e2a184686899
parent6e54a32468e209aa724b37496fcc63f4ebe84f60
builtin/blame.c: refactor commit_info_init() to COMMIT_INFO_INIT macro

Remove the commit_info_init() function addded in ea02ffa3857 (mailmap:
simplify map_user() interface, 2013-01-05) and instead initialize the
"struct commit_info" with a macro.

This is the more idiomatic pattern in the codebase, and doesn't leave
us wondering when we see the *_init() function if this struct needs
more complex initialization than a macro can provide.

The get_commit_info() function is only called by the three callers
being changed here immediately after initializing the struct with the
macros, so by moving the initialization to the callers we don't need
to do it in get_commit_info() anymore.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/blame.c