aports/community/libgit2-glib/support-libgit2-1.9.patch

227 lines
8.0 KiB
Diff

From a80970b89860eb8c1b9435a4b1fcbc4acb36ab9d Mon Sep 17 00:00:00 2001
From: Antoine Jacoutot <ajacoutot@gnome.org>
Date: Thu, 2 Jan 2025 14:03:41 +0100
Subject: [PATCH 1/3] Fix definition of GGIT_MICRO_VERSION.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Replaces: https://gitlab.gnome.org/GNOME/libgit2-glib/-/merge_requests/45
Signed-off-by: Antoine Jacoutot <ajacoutot@gnome.org>
Signed-off-by: Matěj Cepl <mcepl@cepl.eu>
---
libgit2-glib/ggit-version.h.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libgit2-glib/ggit-version.h.in b/libgit2-glib/ggit-version.h.in
index 4b25185..642271b 100644
--- a/libgit2-glib/ggit-version.h.in
+++ b/libgit2-glib/ggit-version.h.in
@@ -35,7 +35,7 @@
*
* libgit2-glib micro version component (e.g. 3 if %GGIT_VERSION is 1.2.3)
*/
-#define GGIT_MINOR_VERSION (@MICRO_VERSION@)
+#define GGIT_MICRO_VERSION (@MICRO_VERSION@)
#define GGIT_ENCODE_VERSION(major,minor,micro) \
((major) << 24 | (minor) << 16 | (micro) << 8)
--
GitLab
From 46e3b75d3cbf0145dab83f5458f08731d7814242 Mon Sep 17 00:00:00 2001
From: Dominique Leuenberger <dimstar@opensuse.org>
Date: Fri, 5 Apr 2024 10:28:16 +0200
Subject: [PATCH 2/3] build: Fix build against, and require, libgit2 1.8.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Replaces: https://gitlab.gnome.org/GNOME/libgit2-glib/-/merge_requests/40
Replaces: https://gitlab.gnome.org/GNOME/libgit2-glib/-/merge_requests/43
Replaces: https://gitlab.gnome.org/GNOME/libgit2-glib/-/merge_requests/44
Signed-off-by: Matěj Cepl <mcepl@cepl.eu>
---
libgit2-glib/ggit-clone-options.c | 7 +++++--
libgit2-glib/ggit-cred-ssh-interactive.c | 2 +-
libgit2-glib/ggit-remote-callbacks.c | 7 ++++++-
libgit2-glib/ggit-remote-callbacks.h | 1 +
libgit2-glib/ggit-repository.c | 4 ++--
libgit2-glib/ggit-types.h | 6 ++++++
6 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/libgit2-glib/ggit-clone-options.c b/libgit2-glib/ggit-clone-options.c
index b47fdb1..70bac69 100644
--- a/libgit2-glib/ggit-clone-options.c
+++ b/libgit2-glib/ggit-clone-options.c
@@ -19,6 +19,9 @@
*/
#include <git2.h>
+#if LIBGIT2_VER_MAJOR > 1 || (LIBGIT2_VER_MAJOR == 1 && LIBGIT2_VER_MINOR >= 8)
+#include <git2/sys/errors.h>
+#endif
#include <gio/gio.h>
#include "ggit-clone-options.h"
@@ -149,7 +152,7 @@ create_repository_wrapper (git_repository **out,
if (error != NULL)
{
-#if LIBGIT2_VER_MAJOR > 0 || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 28)
+#if (LIBGIT2_VER_MAJOR > 0 && LIBGIT2_VER_MINOR < 8) || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 28)
git_error_set_str (GIT_ERROR, error->message);
#else
giterr_set_str (GIT_ERROR, error->message);
@@ -191,7 +194,7 @@ create_remote_wrapper (git_remote **out,
if (error)
{
-#if LIBGIT2_VER_MAJOR > 0 || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 28)
+#if (LIBGIT2_VER_MAJOR > 0 && LIBGIT2_VER_MINOR < 8) || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 28)
git_error_set_str (GIT_ERROR, error->message);
#else
giterr_set_str (GIT_ERROR, error->message);
diff --git a/libgit2-glib/ggit-cred-ssh-interactive.c b/libgit2-glib/ggit-cred-ssh-interactive.c
index 4f60f8b..0bdca95 100644
--- a/libgit2-glib/ggit-cred-ssh-interactive.c
+++ b/libgit2-glib/ggit-cred-ssh-interactive.c
@@ -191,7 +191,7 @@ callback_wrapper (const char *name,
{
gchar *text;
- text = g_strndup (prompts[i].text, prompts[i].length);
+ text = g_strndup ((const gchar *)prompts[i].text, prompts[i].length);
wprompts[i] = ggit_cred_ssh_interactive_prompt_new (wname,
winstruction,
diff --git a/libgit2-glib/ggit-remote-callbacks.c b/libgit2-glib/ggit-remote-callbacks.c
index a1e7b7d..22e5a79 100644
--- a/libgit2-glib/ggit-remote-callbacks.c
+++ b/libgit2-glib/ggit-remote-callbacks.c
@@ -18,6 +18,11 @@
* along with libgit2-glib. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <git2.h>
+#if LIBGIT2_VER_MAJOR > 1 || (LIBGIT2_VER_MAJOR == 1 && LIBGIT2_VER_MINOR >= 8)
+#include <git2/sys/errors.h>
+#endif
+
#include "ggit-remote-callbacks.h"
#include "ggit-cred.h"
#include "ggit-transfer-progress.h"
@@ -160,7 +165,7 @@ credentials_wrap (git_cred **cred,
{
if (error)
{
-#if LIBGIT2_VER_MAJOR > 0 || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 28)
+#if (LIBGIT2_VER_MAJOR > 0 && LIBGIT2_VER_MINOR < 8) || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 28)
git_error_set_str (GIT_ERROR, error->message);
#else
giterr_set_str (GIT_ERROR, error->message);
diff --git a/libgit2-glib/ggit-remote-callbacks.h b/libgit2-glib/ggit-remote-callbacks.h
index 3005ff4..2340712 100644
--- a/libgit2-glib/ggit-remote-callbacks.h
+++ b/libgit2-glib/ggit-remote-callbacks.h
@@ -24,6 +24,7 @@
#include <glib-object.h>
#include <git2.h>
+#include <git2/sys/errors.h>
#include <libgit2-glib/ggit-cred.h>
G_BEGIN_DECLS
diff --git a/libgit2-glib/ggit-repository.c b/libgit2-glib/ggit-repository.c
index bf099f6..936c6fc 100644
--- a/libgit2-glib/ggit-repository.c
+++ b/libgit2-glib/ggit-repository.c
@@ -3182,7 +3182,7 @@ ggit_repository_create_commit (GgitRepository *repository,
message,
_ggit_native_get (tree),
parent_count,
- (const git_commit **)parents_native);
+ (gpointer)parents_native);
g_free (parents_native);
@@ -3323,7 +3323,7 @@ ggit_repository_create_commit_buffer(GgitRepository *repository,
message,
_ggit_tree_get_tree (tree),
parent_count,
- (git_commit const **)parents_native);
+ (gpointer)parents_native);
g_free (parents_native);
diff --git a/libgit2-glib/ggit-types.h b/libgit2-glib/ggit-types.h
index 7e28975..e1d7ecf 100644
--- a/libgit2-glib/ggit-types.h
+++ b/libgit2-glib/ggit-types.h
@@ -21,6 +21,7 @@
#ifndef __GGIT_TYPES_H__
#define __GGIT_TYPES_H__
+#include <git2.h>
#include <glib.h>
G_BEGIN_DECLS
@@ -355,7 +356,12 @@ typedef enum
GGIT_CONFIG_LEVEL_XDG = 3,
GGIT_CONFIG_LEVEL_GLOBAL = 4,
GGIT_CONFIG_LEVEL_LOCAL = 5,
+#if LIBGIT2_VER_MAJOR > 1 || (LIBGIT2_VER_MAJOR == 1 && LIBGIT2_VER_MINOR >= 8)
+ GGIT_CONFIG_LEVEL_WORKTREE = 6,
+ GGIT_CONFIG_LEVEL_APP = 7,
+#else
GGIT_CONFIG_LEVEL_APP = 6,
+#endif
GGIT_CONFIG_LEVEL_HIGHEST = -1
} GgitConfigLevel;
--
GitLab
From 4388ba9c77b7b4285f19a9be0a8a80227bc2f5d8 Mon Sep 17 00:00:00 2001
From: Rui Chen <rui@chenrui.dev>
Date: Mon, 13 Jan 2025 21:23:50 -0500
Subject: [PATCH 3/3] chore: support libgit2 1.9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Replaces: https://gitlab.gnome.org/GNOME/libgit2-glib/-/merge_requests/46
Signed-off-by: Rui Chen <rui@chenrui.dev>
Signed-off-by: Matěj Cepl <mcepl@cepl.eu>
---
libgit2-glib/ggit-types.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libgit2-glib/ggit-types.h b/libgit2-glib/ggit-types.h
index e1d7ecf..c62014f 100644
--- a/libgit2-glib/ggit-types.h
+++ b/libgit2-glib/ggit-types.h
@@ -995,8 +995,7 @@ typedef enum
typedef enum
{
- GGIT_CHECKOUT_NONE = 0,
- GGIT_CHECKOUT_SAFE = (1u << 0),
+ GGIT_CHECKOUT_SAFE = 0,
GGIT_CHECKOUT_FORCE = (1u << 1),
GGIT_CHECKOUT_RECREATE_MISSING = (1u << 2),
GGIT_CHECKOUT_ALLOW_CONFLICTS = (1u << 4),
@@ -1015,6 +1014,7 @@ typedef enum
GGIT_CHECKOUT_CONFLICT_STYLE_DIFF3 = (1u << 21),
GGIT_CHECKOUT_DONT_REMOVE_EXISTING = (1u << 22),
GGIT_CHECKOUT_DONT_WRITE_INDEX = (1u << 23),
+ GGIT_CHECKOUT_NONE = (1u << 30),
GGIT_CHECKOUT_UPDATE_SUBMODULES = (1u << 16),
GGIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED = (1u << 17)
} GgitCheckoutStrategy;
--
GitLab