]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/submodule--helper.c
submodule--helper: refactor get_submodule_displaypath()
authorAtharva Raykar <raykar.ath@gmail.com>
Sat, 5 Mar 2022 00:13:56 +0000 (16:13 -0800)
committerJunio C Hamano <gitster@pobox.com>
Sat, 5 Mar 2022 00:39:12 +0000 (16:39 -0800)
commit5312a850b882d5e4b61b3590a151d41d9a1e8767
treec26f571f8959ca02a99b3dd59e675126a627cad0
parent1012a5cbc3fe4bcfae278a8103e60054d2674784
submodule--helper: refactor get_submodule_displaypath()

We create a function called `do_get_submodule_displaypath()` that
generates the display path required by several submodule functions, and
takes a custom superprefix parameter, instead of reading it from the
environment.

We then redefine the existing `get_submodule_displaypath()` function
as a call to this new function, where the superprefix is obtained from
the environment.

Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Shourya Shukla <periperidip@gmail.com>
Signed-off-by: Atharva Raykar <raykar.ath@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/submodule--helper.c