void-packages/srcpkgs/libgit2-glib/patches/libgit2-1.0.patch

156 lines
5.4 KiB
Diff

commit bcbd4b6c84779413162f1e7fdd2a4a5329fef04a
Author: q66 <daniel@octaforge.org>
Date: Sun May 3 19:27:40 2020 +0200
libgit2 1.0 build fix
diff --git libgit2-glib/ggit-clone-options.c libgit2-glib/ggit-clone-options.c
index 5e69eec..b47fdb1 100644
--- libgit2-glib/ggit-clone-options.c
+++ libgit2-glib/ggit-clone-options.c
@@ -149,7 +149,7 @@ create_repository_wrapper (git_repository **out,
if (error != NULL)
{
-#if LIBGIT2_SOVERSION >= 28
+#if LIBGIT2_VER_MAJOR > 0 || (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 +191,7 @@ create_remote_wrapper (git_remote **out,
if (error)
{
-#if LIBGIT2_SOVERSION >= 28
+#if LIBGIT2_VER_MAJOR > 0 || (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 libgit2-glib/ggit-config.c libgit2-glib/ggit-config.c
index 626f7f0..58c2bbe 100644
--- libgit2-glib/ggit-config.c
+++ libgit2-glib/ggit-config.c
@@ -191,7 +191,7 @@ ggit_config_find_global (void)
if (git_config_find_global (&buf) == GIT_OK)
{
path = g_file_new_for_path (buf.ptr);
-#if LIBGIT2_SOVERSION >= 28
+#if LIBGIT2_VER_MAJOR > 0 || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 28)
git_buf_dispose (&buf);
#else
git_buf_free (&buf);
@@ -224,7 +224,7 @@ ggit_config_find_system (void)
if (git_config_find_system (&buf) == GIT_OK)
{
path = g_file_new_for_path (buf.ptr);
-#if LIBGIT2_SOVERSION >= 28
+#if LIBGIT2_VER_MAJOR > 0 || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 28)
git_buf_dispose (&buf);
#else
git_buf_free (&buf);
@@ -303,9 +303,7 @@ ggit_config_add_file (GgitConfig *config,
ret = git_config_add_file_ondisk (_ggit_native_get (config),
path,
(git_config_level_t)level,
-#if LIBGIT2_SOVERSION >= 27
NULL,
-#endif
force);
g_free (path);
diff --git libgit2-glib/ggit-diff.c libgit2-glib/ggit-diff.c
index 43fa6cf..5189724 100644
--- libgit2-glib/ggit-diff.c
+++ libgit2-glib/ggit-diff.c
@@ -786,7 +786,7 @@ ggit_diff_format_email (GgitDiff *diff,
if (ret != GIT_OK)
{
-#if LIBGIT2_SOVERSION >= 28
+#if LIBGIT2_VER_MAJOR > 0 || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 28)
git_buf_dispose (&buf);
#else
git_buf_free (&buf);
@@ -796,7 +796,7 @@ ggit_diff_format_email (GgitDiff *diff,
}
retval = g_strndup (buf.ptr, buf.size);
-#if LIBGIT2_SOVERSION >= 28
+#if LIBGIT2_VER_MAJOR > 0 || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 28)
git_buf_dispose (&buf);
#else
git_buf_free (&buf);
diff --git libgit2-glib/ggit-error.c libgit2-glib/ggit-error.c
index 9247064..dbdaf4e 100644
--- libgit2-glib/ggit-error.c
+++ libgit2-glib/ggit-error.c
@@ -51,7 +51,7 @@ _ggit_error_set (GError **error,
g_return_if_fail (err < 0);
/* TODO: add more kind of errors, see git_error_t */
-#if LIBGIT2_SOVERSION >= 28
+#if LIBGIT2_VER_MAJOR > 0 || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 28)
git2_err = git_error_last ();
#else
git2_err = giterr_last ();
diff --git libgit2-glib/ggit-message.c libgit2-glib/ggit-message.c
index 7bd6983..4d1b1b8 100644
--- libgit2-glib/ggit-message.c
+++ libgit2-glib/ggit-message.c
@@ -46,7 +46,7 @@ ggit_message_prettify (const gchar *message,
git_message_prettify (&buf, message, strip_comments, comment_char);
d = g_strdup (buf.ptr);
-#if LIBGIT2_SOVERSION >= 28
+#if LIBGIT2_VER_MAJOR > 0 || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 28)
git_buf_dispose (&buf);
#else
git_buf_free (&buf);
diff --git libgit2-glib/ggit-patch.c libgit2-glib/ggit-patch.c
index cd35be7..b544591 100644
--- libgit2-glib/ggit-patch.c
+++ libgit2-glib/ggit-patch.c
@@ -194,7 +194,7 @@ ggit_patch_to_string (GgitPatch *patch,
if (ret == GIT_OK)
{
result = g_strdup (buf.ptr);
-#if LIBGIT2_SOVERSION >= 28
+#if LIBGIT2_VER_MAJOR > 0 || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 28)
git_buf_dispose (&buf);
#else
git_buf_free (&buf);
diff --git libgit2-glib/ggit-remote-callbacks.c libgit2-glib/ggit-remote-callbacks.c
index 7956f8b..a1e7b7d 100644
--- libgit2-glib/ggit-remote-callbacks.c
+++ libgit2-glib/ggit-remote-callbacks.c
@@ -160,7 +160,7 @@ credentials_wrap (git_cred **cred,
{
if (error)
{
-#if LIBGIT2_SOVERSION >= 28
+#if LIBGIT2_VER_MAJOR > 0 || (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 libgit2-glib/ggit-repository.c libgit2-glib/ggit-repository.c
index 42490f4..dd9c7d6 100644
--- libgit2-glib/ggit-repository.c
+++ libgit2-glib/ggit-repository.c
@@ -1013,7 +1013,7 @@ ggit_repository_discover_full (GFile *location,
if (ret == GIT_OK)
{
rep = g_file_new_for_path (buf.ptr);
-#if LIBGIT2_SOVERSION >= 28
+#if LIBGIT2_VER_MAJOR > 0 || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 28)
git_buf_dispose (&buf);
#else
git_buf_free (&buf);
@@ -3684,7 +3684,7 @@ ggit_repository_get_default_notes_ref (GgitRepository *repository,
}
ref = g_strdup (buf.ptr);
-#if LIBGIT2_SOVERSION >= 28
+#if LIBGIT2_VER_MAJOR > 0 || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 28)
git_buf_dispose (&buf);
#else
git_buf_free (&buf);