submodule--helper: add "const" to passed "struct update_data"

Add a "const" to the "struct update_data" passed to run_update_procedure(), which it in turn passes along (peeled) to is_tip_reachable() and fetch_in_submodule()). 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:17 UTC a253be682f96bcb66ea427b9f7421f16dc063676
1 file changed +7 -5
builtin/submodule--helper.c
+7 -5
@@ -2080,7 +2080,7 @@ static int git_update_clone_config(const char *var, const char *value,
2080 return 0;
2081 }
2082
2083 -static int is_tip_reachable(const char *path, struct object_id *oid)
2083 +static int is_tip_reachable(const char *path, const struct object_id *oid)
2084 {
2085 struct child_process cp = CHILD_PROCESS_INIT;
2086 struct strbuf rev = STRBUF_INIT;
@@ -2099,7 +2099,8 @@ static int is_tip_reachable(const char *path, struct object_id *oid)
2099 return 1;
2100 }
2101
2102 -static int fetch_in_submodule(const char *module_path, int depth, int quiet, struct object_id *oid)
2102 +static int fetch_in_submodule(const char *module_path, int depth, int quiet,
2103 + const struct object_id *oid)
2104 {
2105 struct child_process cp = CHILD_PROCESS_INIT;
2106
@@ -2123,7 +2124,7 @@ static int fetch_in_submodule(const char *module_path, int depth, int quiet, str
2124 return run_command(&cp);
2125 }
2126
2126 -static int run_update_command(struct update_data *ud, int subforce)
2127 +static int run_update_command(const struct update_data *ud, int subforce)
2128 {
2129 struct child_process cp = CHILD_PROCESS_INIT;
2130 char *oid = oid_to_hex(&ud->oid);
@@ -2220,7 +2221,7 @@ static int run_update_command(struct update_data *ud, int subforce)
2221 return 0;
2222 }
2223
2223 -static int run_update_procedure(struct update_data *ud)
2224 +static int run_update_procedure(const struct update_data *ud)
2225 {
2226 int subforce = is_null_oid(&ud->suboid) || ud->force;
2227
@@ -2331,7 +2332,8 @@ static const char *submodule_update_type_to_label(enum submodule_update_type typ
2332 BUG("unreachable with type %d", type);
2333 }
2334
2334 -static void update_data_to_args(struct update_data *update_data, struct strvec *args)
2335 +static void update_data_to_args(const struct update_data *update_data,
2336 + struct strvec *args)
2337 {
2338 enum submodule_update_type update_type = update_data->update_default;
2339