diff options
| author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2022-09-01 01:18:13 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-09-02 09:16:25 -0700 |
| commit | f5373deabd537daae3d7c34f6dfa4b62ed45be51 (patch) | |
| tree | 78dffbffc3e7cccb036130b23d7fe48ce56b3499 /commit-graph.c | |
| parent | submodule--helper: check repo{_submodule,}_init() return values (diff) | |
| download | git-f5373deabd537daae3d7c34f6dfa4b62ed45be51.tar.gz git-f5373deabd537daae3d7c34f6dfa4b62ed45be51.zip | |
submodule--helper: libify more "die" paths for module_update()
As noted in a preceding commit the get_default_remote_submodule() and
remote_submodule_branch() functions would invoke die(), and thus leave
update_submodule() only partially lib-ified. Let's address the former
of those cases.
Change the functions to return an int exit code (non-zero on failure),
while leaving the get_default_remote() function for the callers that
still want the die() semantics.
This change addresses 1/2 of the "die" issue in these two lines in
update_submodule():
char *remote_name = get_default_remote_submodule(update_data->sm_path);
const char *branch = remote_submodule_branch(update_data->sm_path);
We can safely remove the "!default_remote" case from sync_submodule(),
because our get_default_remote_submodule() function now returns a
die_message() on failure, so we can have it and other callers check if
the exit code should be non-zero instead.
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
