]> git.ipfire.org Git - thirdparty/git.git/commitdiff
submodule--helper: add "const" to copy of "update_data"
authorGlen Choo <chooglen@google.com>
Wed, 31 Aug 2022 23:17:57 +0000 (01:17 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 2 Sep 2022 16:16:23 +0000 (09:16 -0700)
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>
builtin/submodule--helper.c

index 6b4ee8a31bb5eb633040fc02af78b3c883a10ed3..1391316cde296b9c343ae06ee001c30e5f76bd35 100644 (file)
@@ -1777,7 +1777,7 @@ struct submodule_update_clone {
        int current;
 
        /* configuration parameters which are passed on to the children */
-       struct update_data *update_data;
+       const struct update_data *update_data;
 
        /* to be consumed by update_submodule() */
        struct update_clone_data *update_clone;
@@ -1862,7 +1862,7 @@ static int prepare_to_clone_next_submodule(const struct cache_entry *ce,
        const char *update_string;
        enum submodule_update_type update_type;
        char *key;
-       struct update_data *ud = suc->update_data;
+       const struct update_data *ud = suc->update_data;
        char *displaypath = get_submodule_displaypath(ce->name, ud->prefix);
        struct strbuf sb = STRBUF_INIT;
        int needs_cloning = 0;