]> Kevux Git Server - rit/commit
submodule--helper: remove repeated code in sync_submodule()
authorAtharva Raykar <raykar.ath@gmail.com>
Tue, 10 Aug 2021 11:46:35 +0000 (17:16 +0530)
committerJunio C Hamano <gitster@pobox.com>
Tue, 10 Aug 2021 18:45:11 +0000 (11:45 -0700)
commit0c61041ed6778db86184d7a0d9759085f3cb9a82
tree32f80601fc7a7e2de83a12f371e452e7929a3134
parentab6f23b75129bc20681c0941cdd01d2694bc54f4
submodule--helper: remove repeated code in sync_submodule()

This part of `sync_submodule()` is doing the same thing that
`compute_submodule_clone_url()` is doing. Let's reuse that helper here.

Note that this change adds a small overhead where we allocate and free
the 'remote' twice, but that is a small price to pay for the higher
level of abstraction we get.

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