diff options
| author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2022-09-01 01:18:07 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-09-02 09:16:24 -0700 |
| commit | 2cb9294b99f62bb7439c99ba22898508ba4ff621 (patch) | |
| tree | cffe33d4f3bd936b2c34f3b0f8037f03895ea02e /commit-graph.c | |
| parent | submodule--helper: use "code" in run_update_command() (diff) | |
| download | git-2cb9294b99f62bb7439c99ba22898508ba4ff621.tar.gz git-2cb9294b99f62bb7439c99ba22898508ba4ff621.zip | |
submodule--helper: don't exit() on failure, return
Change code downstream of module_update() to short-circuit and return
to the top-level on failure, rather than calling exit().
To do so we need to diligently check whether we "must_die_on_failure",
which is a pattern started in c51f8f94e5b (submodule--helper: run
update procedures from C, 2021-08-24), but which hadn't been completed
to the point where we could avoid calling exit() here.
This introduces no functional changes, but makes it easier to both
call these routines as a library in the future, and to eventually
avoid leaking memory.
This and similar control flow in submodule--helper.c could be made
simpler by properly "libifying" it, i.e. to have it consistently
return -1 on failures, and to early return on any non-success.
But let's leave that larger project for now, and (mostly) emulate what
were doing with the "exit(128)" before this change.
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>
Diffstat (limited to 'commit-graph.c')
0 files changed, 0 insertions, 0 deletions
