nixpkgs/pkgs/applications/misc/subsurface/0001-core-fix-libgit-ifdef-to-handle-libgit2-v1.0-and-onw.patch
Florian Klink 435ff3118e subsurface: 4.8.2 -> 4.9.3
This bumps subsurface to 4.9.3.

As the subsurface-specific libdivecomputer source is shipped as a git
submodule these days, we can avoid having to fetch a separate tarball
that needs to be kept in sync (and is only uploaded for each release).

This also applies a patch on top of 4.9.3 to properly handle libgit2
versions 1.0 and later - conditional code for older libgit versions has
been removed upstream, but that's a nontrivial backport, which is why
this patch was added.
2020-04-11 12:51:32 +02:00

42 lines
1.5 KiB
Diff

From dfa4bcafec4425659a409550085417af3c5c787b Mon Sep 17 00:00:00 2001
From: Florian Klink <flokli@flokli.de>
Date: Sat, 11 Apr 2020 12:38:38 +0200
Subject: [PATCH] core: fix libgit ifdef to handle libgit2 v1.0 and onwards
Conditional code for older libgit versions was removed in
https://github.com/Subsurface-divelog/subsurface/pull/2737,
but it's a non-trivial backport, and master currently isn't really ready
for a release.
So instead ship a patch fixing the one broken libgit2 conditional until
a 4.10 release has been made.
Note the inverted logic - the if branch now handles the old libgit
condition, and the else branch the newer versions, consistent with how
it's done in the rest of the subsurface codebase.
---
core/git-access.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/core/git-access.c b/core/git-access.c
index 3688cb90c..9997fc8fd 100644
--- a/core/git-access.c
+++ b/core/git-access.c
@@ -359,10 +359,10 @@ static int try_to_git_merge(git_repository *repo, git_reference **local_p, git_r
}
git_merge_init_options(&merge_options, GIT_MERGE_OPTIONS_VERSION);
-#if !LIBGIT2_VER_MAJOR && LIBGIT2_VER_MINOR > 23
- merge_options.flags = GIT_MERGE_FIND_RENAMES;
-#else
+#if !LIBGIT2_VER_MAJOR && LIBGIT2_VER_MINOR <= 22
merge_options.tree_flags = GIT_MERGE_TREE_FIND_RENAMES;
+#else
+ merge_options.flags = GIT_MERGE_FIND_RENAMES;
#endif
merge_options.file_favor = GIT_MERGE_FILE_FAVOR_UNION;
merge_options.rename_threshold = 100;
--
2.25.1