Import from Fedora Rawhide

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
This commit is contained in:
Stephen Gallagher 2024-07-31 13:39:48 -04:00
parent cfcaec180c
commit 749488937e
5 changed files with 15086 additions and 311 deletions

1
.gitignore vendored
View File

@ -37,3 +37,4 @@
/libgit2-1.0.0.tar.gz
/libgit2-1.0.1.tar.gz
/libgit2-1.1.0.tar.gz
/libgit2-1.7.2.tar.gz

File diff suppressed because it is too large Load Diff

View File

@ -1,76 +0,0 @@
From d62e44cb8218840a0291fb5fbb7c5106e1e35a12 Mon Sep 17 00:00:00 2001
From: Segev Finer <segev@codeocean.com>
Date: Mon, 3 Jun 2019 18:35:08 +0300
Subject: [PATCH] checkout: Fix removing untracked files by path in
subdirectories
The checkout code didn't iterate into a subdir if it didn't match the
pathspec, but since the pathspec might match files in the subdir we
should recurse into it (In contrast to gitignore handling).
Fixes #5089
---
src/checkout.c | 9 +++++++--
tests/checkout/head.c | 26 ++++++++++++++++++++++++++
2 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/src/checkout.c b/src/checkout.c
index f0dd736dc..59ff873dd 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -371,8 +371,13 @@ static int checkout_action_wd_only(
if (!git_pathspec__match(
pathspec, wd->path,
(data->strategy & GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH) != 0,
- git_iterator_ignore_case(workdir), NULL, NULL))
- return git_iterator_advance(wditem, workdir);
+ git_iterator_ignore_case(workdir), NULL, NULL)) {
+
+ if (wd->mode == GIT_FILEMODE_TREE)
+ return git_iterator_advance_into(wditem, workdir);
+ else
+ return git_iterator_advance(wditem, workdir);
+ }
/* check if item is tracked in the index but not in the checkout diff */
if (data->index != NULL) {
diff --git a/tests/checkout/head.c b/tests/checkout/head.c
index 799123086..5b3a034e7 100644
--- a/tests/checkout/head.c
+++ b/tests/checkout/head.c
@@ -109,6 +109,32 @@ void test_checkout_head__do_not_remove_untracked_file_in_subdir(void)
cl_assert(git_path_isfile("testrepo/tracked/subdir/untracked"));
}
+void test_checkout_head__do_remove_untracked_paths(void)
+{
+ git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;
+ git_index *index;
+ char *paths[] = {"tracked/untracked"};
+
+ cl_git_pass(p_mkdir("testrepo/tracked", 0755));
+ cl_git_pass(p_mkdir("testrepo/tracked/subdir", 0755));
+ cl_git_mkfile("testrepo/tracked/tracked", "tracked\n");
+ cl_git_mkfile("testrepo/tracked/untracked", "untracked\n");
+
+ cl_git_pass(git_repository_index(&index, g_repo));
+ cl_git_pass(git_index_add_bypath(index, "tracked/tracked"));
+ cl_git_pass(git_index_write(index));
+
+ git_index_free(index);
+
+ opts.checkout_strategy = GIT_CHECKOUT_FORCE | GIT_CHECKOUT_REMOVE_UNTRACKED;
+ opts.paths.strings = paths;
+ opts.paths.count = 1;
+ cl_git_pass(git_checkout_head(g_repo, &opts));
+
+ cl_assert(git_path_isfile("testrepo/tracked/tracked"));
+ cl_assert(!git_path_isfile("testrepo/tracked/untracked"));
+}
+
void test_checkout_head__do_remove_tracked_subdir(void)
{
git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;
--
2.27.0

View File

@ -1,22 +1,40 @@
# libssh2 is not available on RHEL
%if 0%{?rhel}
%bcond_with libssh2
%else
%bcond_without libssh2
%endif
Name: libgit2
Version: 1.1.0
Release: 3%{?dist}
Version: 1.7.2
Release: %autorelease
Summary: C implementation of the Git core methods as a library with a solid API
License: GPLv2 with exceptions
URL: https://libgit2.org/
Source0: https://github.com/libgit2/libgit2/archive/v%{version}/%{name}-%{version}.tar.gz
Source0: https://github.com/libgit2/libgit2/archive/refs/tags/v%{version}.tar.gz#/libgit2-%{version}.tar.gz
# Patches
# Backported patch from https://github.com/libgit2/libgit2/pull/6713
Patch: 0001-Replace-http-parser-with-llhttp.patch
BuildRequires: gcc
BuildRequires: cmake >= 3.5.1
BuildRequires: ninja-build
BuildRequires: http-parser-devel
BuildRequires: llhttp-devel
BuildRequires: krb5-devel
BuildRequires: libcurl-devel
%if %{with libssh2}
BuildRequires: libssh2-devel
%endif
BuildRequires: openssl-devel
BuildRequires: pcre2-devel
BuildRequires: python3
BuildRequires: zlib-devel
Provides: bundled(libxdiff)
%if 0%{?fedora} >= 38
Obsoletes: libgit2_1.3 < 1.3.2-3
Obsoletes: libgit2_1.4 < 1.4.6-3
%endif
%description
libgit2 is a portable, pure C implementation of the Git core methods
@ -27,44 +45,65 @@ with bindings.
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
%if 0%{?fedora} >= 38
Obsoletes: libgit2_1.3-devel < 1.3.2-3
Obsoletes: libgit2_1.4-devel < 1.4.6-3
%endif
%description devel
This package contains libraries and header files for
developing applications that use %{name}.
%prep
%autosetup -p1
%autosetup -p1 -n libgit2-%{version}
# Remove VCS files from examples
find examples -name ".gitignore" -delete -print
# Don't run "online" tests
sed -i '/-sonline/s/^/#/' tests/CMakeLists.txt
sed -i '/-sonline/s/^/#/' tests/libgit2/CMakeLists.txt
# Remove bundled libraries
rm -vr deps
%if 0%{?fedora} >= 40 || 0%{?rhel} >= 10
# On Fedora 40+ and RHEL 10+, we're using zlib-ng rather than
# zlib for compression. As a result, all of the pack tests fail
# due to checking the hashes of the packed data against static
# values that were created with zlib.
# https://github.com/libgit2/libgit2/issues/6728
sed -i 's/-xonline/-xonline -xpack/' tests/libgit2/CMakeLists.txt
%endif
# Remove bundled libraries (except libxdiff)
pushd deps
find . -maxdepth 1 -not -name xdiff -exec rm -rf {} ';'
popd
%build
%cmake . -B%{_target_platform} \
%cmake \
-GNinja \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DREGEX_BACKEND=pcre2 \
-DUSE_HTTP_PARSER=system \
-DBUILD_CLI=OFF \
-DUSE_HTTP_PARSER=llhttp \
-DUSE_SHA1=HTTPS \
-DUSE_HTTPS=OpenSSL \
-DUSE_NTLMCLIENT=OFF \
%if %{with libssh2}
-DUSE_SSH=ON \
%else
-DUSE_SSH=OFF \
%endif
%{nil}
%ninja_build -C %{_target_platform}
%cmake_build
%install
%ninja_install -C %{_target_platform}
%cmake_install
%check
%ninja_test -C %{_target_platform}
%ctest
%files
%license COPYING
%{_libdir}/libgit2.so.*
%{_libdir}/libgit2.so.1.7*
%files devel
%doc AUTHORS docs examples README.md
@ -74,223 +113,4 @@ rm -vr deps
%{_includedir}/git2/
%changelog
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Mon Dec 28 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 1.1.0-2
- Rebuild
* Mon Dec 28 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 1.1.0-1
- Update to 1.1.0
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Mon Jun 15 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 1.0.1-2
- Fix removing untracked files by path in subdirectories
* Thu Jun 04 2020 Pete Walter <pwalter@fedoraproject.org> - 1.0.1-1
- Update to 1.0.1
* Wed Apr 15 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 1.0.0-2
- Rebuild for http-parser 2.9.4
* Wed Apr 15 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 1.0.0-1
- Update to 1.0.0
* Tue Mar 03 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 0.99.0-2
- Fix broken deps for pcre2
* Mon Mar 02 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 0.99.0-1
- Update to 0.99.0
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.28.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Wed Dec 11 09:00:52 CET 2019 Igor Gnatenko <ingnatenkobrain@fedoraproject.org> - 0.28.4-1
- Update to 0.28.4
* Fri Sep 13 2019 Pete Walter <pwalter@fedoraproject.org> - 0.28.3-1
- Update to 0.28.3
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.28.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Sun Jul 14 13:34:04 CEST 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.28.2-2
- Obsolete libgit2_0.28
* Thu Jun 06 14:22:16 CEST 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.28.2-1
- Update to 0.28.2
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.27.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Mon Jan 28 2019 Pete Walter <pwalter@fedoraproject.org> - 0.27.8-1
- Update to 0.27.8
* Fri Oct 26 2018 Pete Walter <pwalter@fedoraproject.org> - 0.27.7-1
- Update to 0.27.7
* Mon Oct 08 2018 Pete Walter <pwalter@fedoraproject.org> - 0.27.5-1
- Update to 0.27.5
* Fri Aug 10 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.27.4-1
- Update to 0.27.4
- Update upstream URL
* Tue Aug 07 2018 Pete Walter <pwalter@fedoraproject.org> - 0.26.6-1
- Update to 0.26.6
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.26.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Jul 10 2018 Pete Walter <pwalter@fedoraproject.org> - 0.26.5-1
- Update to 0.26.5 (CVE-2018-10887, CVE-2018-10888)
* Mon Jun 25 2018 Pete Walter <pwalter@fedoraproject.org> - 0.26.4-1
- Update to 0.26.4 (CVE-2018-11235)
* Mon Mar 12 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.26.3-1
- Update to 0.26.3
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.26.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Fri Feb 02 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.26.0-4
- Switch to %%ldconfig_scriptlets
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.26.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.26.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sat Jul 08 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.26.0-1
- Update to 0.26.0
* Tue Feb 07 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.25.1-3
- Backport patch to fix pkgconfig file under g-ir-scanner
* Tue Feb 07 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.25.1-2
- Bump release for rebuild
* Tue Feb 07 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.25.1-1
- Update to 0.25.1 (RHBZ #1395926)
* Tue Jan 10 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.24.6-1
- Update to 0.24.6 (RHBZ #1411857)
* Thu Nov 03 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.24.3-1
- Update to 0.24.3 (RHBZ #1391480)
- Add support for OpenSSL 1.1.0 (RHBZ #1383753)
* Mon Oct 10 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.24.2-2
- Backport patch for CVE-2016-8568, CVE-2016-8569
* Tue Oct 04 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.24.2-1
- Update to 0.24.2 (RHBZ #1381398)
* Wed Apr 13 2016 Igor Gnatenko <ignatenko@redhat.com> - 0.24.1-1
- Update to 0.24.1
* Sun Mar 20 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.24.0-1
- Update to 0.24.0 (RHBZ #1310638)
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.23.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Sun Nov 22 2015 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.23.4-1
- Update to 0.23.4 (RHBZ #1281633)
* Tue Oct 06 2015 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.23.3-1
- Update to 0.23.3 (RHBZ #1260324)
* Tue Sep 08 2015 Igor Gnatenko <ignatenko@src.gnome.org> - 0.23.2-1
- Update to 0.23.2
* Wed Sep 02 2015 Veeti Paananen <veeti.paananen@rojekti.fi> - 0.23.1-1
- Update to 0.23.1
- Add curl support
* Thu Jul 30 2015 Igor Gnatenko <ignatenko@src.gnome.org> - 0.23.0-1
- Update to 0.23.0
* Fri Jul 03 2015 Veeti Paananen <veeti.paananen@rojekti.fi> - 0.22.3-1
- Update to 0.22.3
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.22.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Tue Mar 24 2015 Veeti Paananen <veeti.paananen@rojekti.fi> - 0.22.2-1
- Update to 0.22.2
* Sat Feb 14 2015 Veeti Paananen <veeti.paananen@rojekti.fi> - 0.22.1-1
- Update to 0.22.1
* Mon Jan 19 2015 Ignacio Casal Quinteiro <icq@gnome.org> - 0.22.0-1
- Update to 0.22.0
* Fri Dec 26 2014 Veeti Paananen <veeti.paananen@rojekti.fi> - 0.21.3-1
- Update to 0.21.3
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.21.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Wed Aug 06 2014 Christopher Meng <rpm@cicku.me> - 0.21.1-1
- Update to 0.21.1
* Fri Jul 18 2014 Yaakov Selkowitz <yselkowi@redhat.com> - 0.21.0-2
- Fix memory alignment issues on arm, aarch64, ppc64le (#1115905)
* Sat Jun 21 2014 Christopher Meng <rpm@cicku.me> - 0.21.0-1
- Update to 0.21.0
* Fri Jun 06 2014 Karsten Hopp <karsten@redhat.com> 0.20.0-4
- temporarily disable checks on ppc64 and s390x (Bugzilla 1105552)
* Thu Mar 27 2014 Mathieu Bridon <bochecha@fedoraproject.org> - 0.20.0-3
- Fix build requirement on libssh2-devel. (RHBZ#1039433)
* Tue Mar 25 2014 Mathieu Bridon <bochecha@fedoraproject.org> - 0.20.0-2
- Build with the bundled xdiff.
- Disable a failing test. (libgit2#2199)
- Add missing build requirement on libssh2. (RHBZ#1039433)
- Build a thread-safe libgit2.
* Sun Nov 24 2013 Ignacio Casal Quinteiro <icq@gnome.org> - 0.20.0-1
- 0.20.0
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.19.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Tue Jun 25 2013 Veeti Paananen <veeti.paananen@rojekti.fi> - 0.19.0-1
- 0.19.0
* Wed Jun 19 2013 Dan Horák <dan[at]danny.cz> - 0.18.0-5
- Add htonl() and friends declarations on non-x86 arches
- Rebuilt with fixed libxdiff for big endian arches
* Thu May 30 2013 Veeti Paananen <veeti.paananen@rojekti.fi> - 0.18.0-4
- Update the http-parser patch
- Skip tests that require network connectivity
* Thu May 30 2013 Tom Callaway <spot@fedoraproject.org> - 0.18.0-3
- use system libxdiff instead of bundled copy
* Fri May 24 2013 Veeti Paananen <veeti.paananen@rojekti.fi> - 0.18.0-2
- Remove unnecessary CMake build flags
- Fix the pkgconfig file
* Thu May 02 2013 Veeti Paananen <veeti.paananen@rojekti.fi> - 0.18.0-1
- Update to version 0.18.0
- Unbundle the http-parser library
* Fri Oct 19 2012 Veeti Paananen <veeti.paananen@rojekti.fi> - 0.17.0-2
- Use make for building and installation
- Specify minimum CMake version
- Remove useless OpenSSL build dependency
- Move development documentation to the -devel package
- Add code examples to the -devel package
* Thu Oct 18 2012 Veeti Paananen <veeti.paananen@rojekti.fi> - 0.17.0-1
- Initial package.
%autochangelog

View File

@ -1 +1 @@
SHA512 (libgit2-1.1.0.tar.gz) = 347bb68900181b44fa58a0417506c91383adb965607fce049a5b4c57ac9cc286e0a140d164c339b50fb6cd6951f47757c2917a2df44ba004bfaa4fb643946bb8
SHA512 (libgit2-1.7.2.tar.gz) = 825737e4a1991fba50ea535f15b0e560ebe76ead752e04aeba36925b944d0da77fe9826a70980a1aa3d0bf9afbedfab79dd92e799c9252931384c89ebec9b012