summaryrefslogtreecommitdiff
path: root/builtin/submodule--helper.c
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-08-31 23:17:58 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-09-02 16:16:23 (GMT)
commita253be682f96bcb66ea427b9f7421f16dc063676 (patch)
tree600c5e27cd3612e8bc148fcc9760f365fa6e3308 /builtin/submodule--helper.c
parent1da635b84d438d46f1a87ee49bea416513193785 (diff)
downloadgit-a253be682f96bcb66ea427b9f7421f16dc063676.zip
git-a253be682f96bcb66ea427b9f7421f16dc063676.tar.gz
git-a253be682f96bcb66ea427b9f7421f16dc063676.tar.bz2
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>
Diffstat (limited to 'builtin/submodule--helper.c')
-rw-r--r--builtin/submodule--helper.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index 1391316..7e70f49 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -2080,7 +2080,7 @@ static int git_update_clone_config(const char *var, const char *value,
return 0;
}
-static int is_tip_reachable(const char *path, struct object_id *oid)
+static int is_tip_reachable(const char *path, const struct object_id *oid)
{
struct child_process cp = CHILD_PROCESS_INIT;
struct strbuf rev = STRBUF_INIT;
@@ -2099,7 +2099,8 @@ static int is_tip_reachable(const char *path, struct object_id *oid)
return 1;
}
-static int fetch_in_submodule(const char *module_path, int depth, int quiet, struct object_id *oid)
+static int fetch_in_submodule(const char *module_path, int depth, int quiet,
+ const struct object_id *oid)
{
struct child_process cp = CHILD_PROCESS_INIT;
@@ -2123,7 +2124,7 @@ static int fetch_in_submodule(const char *module_path, int depth, int quiet, str
return run_command(&cp);
}
-static int run_update_command(struct update_data *ud, int subforce)
+static int run_update_command(const struct update_data *ud, int subforce)
{
struct child_process cp = CHILD_PROCESS_INIT;
char *oid = oid_to_hex(&ud->oid);
@@ -2220,7 +2221,7 @@ static int run_update_command(struct update_data *ud, int subforce)
return 0;
}
-static int run_update_procedure(struct update_data *ud)
+static int run_update_procedure(const struct update_data *ud)
{
int subforce = is_null_oid(&ud->suboid) || ud->force;
@@ -2331,7 +2332,8 @@ static const char *submodule_update_type_to_label(enum submodule_update_type typ
BUG("unreachable with type %d", type);
}
-static void update_data_to_args(struct update_data *update_data, struct strvec *args)
+static void update_data_to_args(const struct update_data *update_data,
+ struct strvec *args)
{
enum submodule_update_type update_type = update_data->update_default;