help: convert git_cmd to page in one place
commitd5659f856f3084d33d2379958dd3eefd8a24379f
authorAndrei Rybak <rybak.a.v@gmail.com>
Sun, 4 Jul 2021 15:39:12 +0000 (4 17:39 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 6 Jul 2021 20:09:20 +0000 (6 13:09 -0700)
treea44eb23b93166d2e91286cb718681aa88a78a7e9
parent670b81a890388c60b7032a4f5b879f2ece8c4558
help: convert git_cmd to page in one place

Depending on the chosen format of help pages, git-help uses function
show_man_page, show_info_page, or show_html_page.  The first thing all
three functions do is to convert given `git_cmd` to a `page` using
function cmd_to_page.

Move the common part of these three functions to function cmd_help to
avoid code duplication.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
Reviewed-by: Felipe Contreras <felipe.contreras@gmail.com>
Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/help.c