[libgit2-glib] ggit_repository_merge: Fix constness of their_heads_native



commit 56cccb51501936d1a5ba2dac889109cfb553de63
Author: Jan Alexander Steffens (heftig) <jan steffens gmail com>
Date:   Sun Mar 1 17:31:10 2020 +0000

    ggit_repository_merge: Fix constness of their_heads_native
    
    git_merge expects const data.

 libgit2-glib/ggit-repository.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/libgit2-glib/ggit-repository.c b/libgit2-glib/ggit-repository.c
index 68fdb31..a2a4301 100644
--- a/libgit2-glib/ggit-repository.c
+++ b/libgit2-glib/ggit-repository.c
@@ -4030,8 +4030,9 @@ ggit_repository_merge (GgitRepository       *repository,
                        GgitCheckoutOptions  *checkout_opts,
                        GError              **error)
 {
-       gint ret, i;
-       git_annotated_commit **their_heads_native;
+       gint ret;
+       gsize i;
+       const git_annotated_commit **their_heads_native;
 
        g_return_if_fail (GGIT_IS_REPOSITORY (repository));
        g_return_if_fail (their_heads != NULL);
@@ -4039,7 +4040,7 @@ ggit_repository_merge (GgitRepository       *repository,
        g_return_if_fail (GGIT_IS_CHECKOUT_OPTIONS (checkout_opts));
        g_return_if_fail (error == NULL || *error == NULL);
 
-       their_heads_native = g_new0 (git_annotated_commit *, their_heads_length);
+       their_heads_native = g_new0 (const git_annotated_commit *, their_heads_length);
 
        for (i = 0; i < their_heads_length; ++i)
        {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]