submodule--helper: add "const" to copy of "update_data"

Add a "const" to the copy of "struct update_data" that's tracked by the "struct submodule_update_clone", as it neither owns nor modifies it. Signed-off-by: Glen Choo <chooglen@google.com> 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>

Glen Choo committed Sep 1, 2022 at 01:17 UTC 1da635b84d438d46f1a87ee49bea416513193785
1 file changed +2 -2
builtin/submodule--helper.c
+2 -2
@@ -1777,7 +1777,7 @@ struct submodule_update_clone {
1777 int current;
1778
1779 /* configuration parameters which are passed on to the children */
1780 - struct update_data *update_data;
1780 + const struct update_data *update_data;
1781
1782 /* to be consumed by update_submodule() */
1783 struct update_clone_data *update_clone;
@@ -1862,7 +1862,7 @@ static int prepare_to_clone_next_submodule(const struct cache_entry *ce,
1862 const char *update_string;
1863 enum submodule_update_type update_type;
1864 char *key;
1865 - struct update_data *ud = suc->update_data;
1865 + const struct update_data *ud = suc->update_data;
1866 char *displaypath = get_submodule_displaypath(ce->name, ud->prefix);
1867 struct strbuf sb = STRBUF_INIT;
1868 int needs_cloning = 0;