submodule--helper: rename "int res" to "int ret"

Rename the "res" variable added in b3c5f5cb048 (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 in b3c5f5cb048. 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>

Ævar Arnfjörð Bjarmason committed Sep 1, 2022 at 01:18 UTC addda284cbcde90b8b541caf94f198ed2f6bd936
1 file changed +9 -9
builtin/submodule--helper.c
+9 -9
@@ -2426,7 +2426,7 @@ static int update_submodule(struct update_data *update_data)
2426 if (update_data->recursive) {
2427 struct child_process cp = CHILD_PROCESS_INIT;
2428 struct update_data next = *update_data;
2429 - int res;
2429 + int ret;
2430
2431 next.prefix = NULL;
2432 oidcpy(&next.oid, null_oid());
@@ -2438,13 +2438,13 @@ static int update_submodule(struct update_data *update_data)
2438 update_data_to_args(&next, &cp.args);
2439
2440 /* die() if child process die()'d */
2441 - res = run_command(&cp);
2442 - if (!res)
2441 + ret = run_command(&cp);
2442 + if (!ret)
2443 return 0;
2444 die_message(_("Failed to recurse into submodule path '%s'"),
2445 update_data->displaypath);
2446 - if (res == 128)
2447 - exit(res);
2446 + if (ret == 128)
2447 + exit(ret);
2448 return 1;
2449 }
2450
@@ -2453,7 +2453,7 @@ static int update_submodule(struct update_data *update_data)
2453
2454 static int update_submodules(struct update_data *update_data)
2455 {
2456 - int i, res = 0;
2456 + int i, ret = 0;
2457 struct submodule_update_clone suc = SUBMODULE_UPDATE_CLONE_INIT;
2458
2459 suc.update_data = update_data;
@@ -2471,7 +2471,7 @@ static int update_submodules(struct update_data *update_data)
2471 * - the listener can avoid doing any work if fetching failed.
2472 */
2473 if (suc.quickstop) {
2474 - res = 1;
2474 + ret = 1;
2475 goto cleanup;
2476 }
2477
@@ -2483,12 +2483,12 @@ static int update_submodules(struct update_data *update_data)
2483 update_data->sm_path = ucd.sub->path;
2484
2485 if (update_submodule(update_data))
2486 - res = 1;
2486 + ret = 1;
2487 }
2488
2489 cleanup:
2490 string_list_clear(&update_data->references, 0);
2491 - return res;
2491 + return ret;
2492 }
2493
2494 static int module_update(int argc, const char **argv, const char *prefix)