Compare commits

..

11 Commits
f31 ... rawhide

Author SHA1 Message Date
Sahana Prasad
e16f348ab1 Rebuilt with OpenSSL 3.0.0 2021-09-14 19:06:06 +02:00
Fedora Release Engineering
a42969342f - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-22 11:27:34 +00:00
Kamil Dudka
9642d1a969 make the run-time dependency on libssh2 optional 2021-03-18 17:15:36 +01:00
Fedora Release Engineering
b8681828d9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-26 17:08:36 +00:00
Igor Raits
60426eb85c
Rebuild
Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
2020-12-28 18:55:46 +01:00
Igor Raits
04872ae579
Update to 1.1.0
Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
2020-12-28 17:44:07 +01:00
Fedora Release Engineering
e62c539ed5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-07-28 04:43:48 +00:00
Igor Raits
120fe87648
Fix removing untracked files by path in subdirectories
Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
2020-06-15 14:39:42 +02:00
Pete Walter
a25515cceb Update to 1.0.1 2020-06-04 11:52:11 +01:00
Igor Raits
e3151b3f27
Rebuild for http-parser 2.9.4
Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
2020-04-15 17:51:43 +02:00
Igor Raits
f37fab884c
Update to 1.0.0
Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
2020-04-15 08:51:48 +02:00
4 changed files with 142 additions and 16 deletions

5
.gitignore vendored
View File

@ -33,4 +33,7 @@
/libgit2-0.28.2.tar.gz
/libgit2-0.28.3.tar.gz
/libgit2-0.28.4.tar.gz
/libgit2-0.28.5.tar.gz
/libgit2-0.99.0.tar.gz
/libgit2-1.0.0.tar.gz
/libgit2-1.0.1.tar.gz
/libgit2-1.1.0.tar.gz

View File

@ -0,0 +1,76 @@
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,31 @@
# libssh2 is not available on RHEL
%if 0%{?rhel}
%bcond_with libssh2
%else
%bcond_without libssh2
%endif
Name: libgit2
Version: 0.28.5
Release: 1%{?dist}
Version: 1.1.0
Release: 6%{?dist}
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
BuildRequires: gcc
BuildRequires: cmake >= 2.8.11
BuildRequires: cmake >= 3.5.1
BuildRequires: ninja-build
BuildRequires: http-parser-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)
Obsoletes: libgit2_0.28 < 0.28.4-2
%description
libgit2 is a portable, pure C implementation of the Git core methods
@ -27,7 +36,6 @@ with bindings.
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes: libgit2_0.28-devel < 0.28.4-2
%description devel
This package contains libraries and header files for
@ -40,17 +48,23 @@ developing applications that use %{name}.
find examples -name ".gitignore" -delete -print
# Don't run "online" tests
sed -i '/ADD_TEST(online/s/^/#/' tests/CMakeLists.txt
sed -i '/-sonline/s/^/#/' tests/CMakeLists.txt
# Remove bundled libraries
rm -frv deps
rm -vr deps
%build
%cmake . -B%{_target_platform} \
-GNinja \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DSHA1_BACKEND=OpenSSL \
-DREGEX_BACKEND=pcre2 \
-DUSE_HTTP_PARSER=system \
-DUSE_SHA1=HTTPS \
-DUSE_HTTPS=OpenSSL \
-DUSE_NTLMCLIENT=OFF \
%if %{without libssh2}
-DUSE_SSH=OFF \
%endif
%{nil}
%ninja_build -C %{_target_platform}
@ -72,14 +86,47 @@ rm -frv deps
%{_includedir}/git2/
%changelog
* Wed Apr 01 2020 Pete Walter <pwalter@fedoraproject.org> - 0.28.5-1
- Update to 0.28.5
* Tue Sep 14 2021 Sahana Prasad <sahana@redhat.com> - 1.1.0-6
- Rebuilt with OpenSSL 3.0.0
* Thu Mar 19 2020 Pete Walter <pwalter@fedoraproject.org> - 0.28.4-3
- Rebuild against http-parser 2.9.3 (#1814897)
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Sun Mar 15 2020 Pete Walter <pwalter@fedoraproject.org> - 0.28.4-2
- Bump libgit2_0.28 obsoletes versions
* Thu Mar 18 2021 Kamil Dudka <kdudka@redhat.com> - 1.1.0-4
- make the run-time dependency on libssh2 optional
* 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

View File

@ -1 +1 @@
SHA512 (libgit2-0.28.5.tar.gz) = abfea885f46444b0304ae57c32c06f4252afb0093c924da5e1ba10aaed952824d1b84036adb79b5b8ad8bea56a6331a51c62f3b9839aead16c7b26cb4554b53a
SHA512 (libgit2-1.1.0.tar.gz) = 347bb68900181b44fa58a0417506c91383adb965607fce049a5b4c57ac9cc286e0a140d164c339b50fb6cd6951f47757c2917a2df44ba004bfaa4fb643946bb8