[libgit2/f21] Backport crash fix
Veeti Paananen
vpaan at fedoraproject.org
Mon Feb 16 16:14:03 UTC 2015
commit 55eaa68e02eaab6f9d802a0611ee40cd0e23c723
Author: Veeti Paananen <veeti.paananen at rojekti.fi>
Date: Mon Feb 16 18:13:27 2015 +0200
Backport crash fix
libgit2-0.21.0-segfault.patch | 30 ++++++++++++++++++++++++++++++
libgit2.spec | 9 ++++++++-
2 files changed, 38 insertions(+), 1 deletions(-)
---
diff --git a/libgit2-0.21.0-segfault.patch b/libgit2-0.21.0-segfault.patch
new file mode 100644
index 0000000..ddad1b2
--- /dev/null
+++ b/libgit2-0.21.0-segfault.patch
@@ -0,0 +1,30 @@
+From 0b6699b8dd75de99d9c7944c90f071c11b265bc5 Mon Sep 17 00:00:00 2001
+From: Veeti Paananen <veeti.paananen at rojekti.fi>
+Date: Mon, 16 Feb 2015 17:55:20 +0200
+Subject: [PATCH] Backport 6d20006f7e8dbc26cf07bf8a945bc6972642c303
+
+remote: check the relevance of the refspec when updating FETCH_HEAD
+
+Before trying to rtransform using the given refspec to figure out what
+the name of the upstream branch is on the remote, we must make sure
+that the target of the refspec applies to the current branch's
+upstream.
+---
+ src/remote.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/remote.c b/src/remote.c
+index aa70bb7..c8c6a84 100644
+--- a/src/remote.c
++++ b/src/remote.c
+@@ -917,6 +917,7 @@ static int remote_head_for_ref(git_remote_head **out, git_refspec *spec, git_vec
+
+ if ((!git_reference__is_branch(ref_name)) ||
+ (error = git_branch_upstream_name(&upstream_name, repo, ref_name)) < 0 ||
++ !git_refspec_dst_matches(spec, git_buf_cstr(&upstream_name)) ||
+ (error = git_refspec_rtransform(&remote_name, spec, upstream_name.ptr)) < 0) {
+ /* Not an error if there is no upstream */
+ if (error == GIT_ENOTFOUND)
+--
+2.3.0
+
diff --git a/libgit2.spec b/libgit2.spec
index 9469b2a..d5bb164 100644
--- a/libgit2.spec
+++ b/libgit2.spec
@@ -1,12 +1,13 @@
Name: libgit2
Version: 0.21.1
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: C implementation of the Git core methods as a library with a solid API
License: GPLv2 with exceptions
URL: http://libgit2.github.com/
Source0: https://github.com/libgit2/libgit2/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
# https://github.com/libgit2/libgit2/issues/2450
#Patch0: libgit2-0.21.0-arm.patch
+Patch0: libgit2-0.21.0-segfault.patch
BuildRequires: cmake
BuildRequires: http-parser-devel
BuildRequires: libssh2-devel
@@ -44,6 +45,9 @@ sed -i 's/ionline/xonline/' CMakeLists.txt
# Remove bundled libraries
rm -frv deps
+# Run patches
+%patch0 -p1
+
%build
%cmake -DTHREADSAFE=ON .
%make_build
@@ -73,6 +77,9 @@ ctest -V
%{_includedir}/git2/
%changelog
+* Mon Feb 16 2015 Veeti Paananen <veeti.paananen at rojekti.fi> - 0.21.1-3
+- Backport crash fix
+
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.21.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
More information about the scm-commits
mailing list