fetch: refactor `s_update_ref` to use common exit path
commitc45889f10453864130ccbfa45815e2f4e384ab5e
authorPatrick Steinhardt <ps@pks.im>
Tue, 12 Jan 2021 12:27:43 +0000 (12 13:27 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 12 Jan 2021 20:06:15 +0000 (12 12:06 -0800)
tree8ca34d83ff300d9710499d778a7a24f371bef195
parent929d044575ed4f9657074f098e3a9be410d511ef
fetch: refactor `s_update_ref` to use common exit path

The cleanup code in `s_update_ref()` is currently duplicated for both
succesful and erroneous exit paths. This commit refactors the function
to have a shared exit path for both cases to remove the duplication.

Suggested-by: Christian Couder <christian.couder@gmail.com>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fetch.c