]> git.ipfire.org Git - thirdparty/git.git/commit
submodule--helper: libify "must_die_on_failure" code paths (for die)
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Wed, 31 Aug 2022 23:18:11 +0000 (01:18 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 2 Sep 2022 16:16:24 +0000 (09:16 -0700)
commitac350155de34767e132b383fb1b819ff74e23842
treeef71b903ff1f68e18d0ef68ce620a720f5ecf5fd
parenta03c01de2fbb1e83138d83095ddacd1417f49b66
submodule--helper: libify "must_die_on_failure" code paths (for die)

Continue the libification of codepaths that previously relied on
"must_die_on_failure". In these cases we've always been early aborting
by calling die(), but as we know that these codepaths will properly
handle return codes of 128 to mean an early abort let's have them use
die_message() instead.

This still isn't a complete migration away from die() for these
codepaths, in particular this code in update_submodule() will still call die() in some cases:

char *remote_name = get_default_remote_submodule(update_data->sm_path);
const char *branch = remote_submodule_branch(update_data->sm_path);

But as that code is used by other callers than the "update" code let's
leave converting it for a subsequent commit.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Reviewed-by: Glen Choo <chooglen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/submodule--helper.c