submodule--helper: rename "int res" to "int ret"
Rename the "res" variable added inb3c5f5cb04
(submodule: move core cmd_update() logic to C, 2022-03-15) to "ret", which is the convention in the rest of this file. Eventual follow-up commits will change the code in update_submodule() to a "goto cleanup" pattern, let's have the post image look consistent with the rest. For update_submodules() let's also use a "ret" for consistency, that use was also added inb3c5f5cb04
. We'll be modifying that codepath in subsequent commits. 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>
This commit is contained in:

committed by
Junio C Hamano

parent
b0bff0be54
commit
addda284cb
@ -2426,7 +2426,7 @@ static int update_submodule(struct update_data *update_data)
|
|||||||
if (update_data->recursive) {
|
if (update_data->recursive) {
|
||||||
struct child_process cp = CHILD_PROCESS_INIT;
|
struct child_process cp = CHILD_PROCESS_INIT;
|
||||||
struct update_data next = *update_data;
|
struct update_data next = *update_data;
|
||||||
int res;
|
int ret;
|
||||||
|
|
||||||
next.prefix = NULL;
|
next.prefix = NULL;
|
||||||
oidcpy(&next.oid, null_oid());
|
oidcpy(&next.oid, null_oid());
|
||||||
@ -2438,13 +2438,13 @@ static int update_submodule(struct update_data *update_data)
|
|||||||
update_data_to_args(&next, &cp.args);
|
update_data_to_args(&next, &cp.args);
|
||||||
|
|
||||||
/* die() if child process die()'d */
|
/* die() if child process die()'d */
|
||||||
res = run_command(&cp);
|
ret = run_command(&cp);
|
||||||
if (!res)
|
if (!ret)
|
||||||
return 0;
|
return 0;
|
||||||
die_message(_("Failed to recurse into submodule path '%s'"),
|
die_message(_("Failed to recurse into submodule path '%s'"),
|
||||||
update_data->displaypath);
|
update_data->displaypath);
|
||||||
if (res == 128)
|
if (ret == 128)
|
||||||
exit(res);
|
exit(ret);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2453,7 +2453,7 @@ static int update_submodule(struct update_data *update_data)
|
|||||||
|
|
||||||
static int update_submodules(struct update_data *update_data)
|
static int update_submodules(struct update_data *update_data)
|
||||||
{
|
{
|
||||||
int i, res = 0;
|
int i, ret = 0;
|
||||||
struct submodule_update_clone suc = SUBMODULE_UPDATE_CLONE_INIT;
|
struct submodule_update_clone suc = SUBMODULE_UPDATE_CLONE_INIT;
|
||||||
|
|
||||||
suc.update_data = update_data;
|
suc.update_data = update_data;
|
||||||
@ -2471,7 +2471,7 @@ static int update_submodules(struct update_data *update_data)
|
|||||||
* - the listener can avoid doing any work if fetching failed.
|
* - the listener can avoid doing any work if fetching failed.
|
||||||
*/
|
*/
|
||||||
if (suc.quickstop) {
|
if (suc.quickstop) {
|
||||||
res = 1;
|
ret = 1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2483,12 +2483,12 @@ static int update_submodules(struct update_data *update_data)
|
|||||||
update_data->sm_path = ucd.sub->path;
|
update_data->sm_path = ucd.sub->path;
|
||||||
|
|
||||||
if (update_submodule(update_data))
|
if (update_submodule(update_data))
|
||||||
res = 1;
|
ret = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
string_list_clear(&update_data->references, 0);
|
string_list_clear(&update_data->references, 0);
|
||||||
return res;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int module_update(int argc, const char **argv, const char *prefix)
|
static int module_update(int argc, const char **argv, const char *prefix)
|
||||||
|
Reference in New Issue
Block a user