Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
7bdd1eaff2 | ||
|
d957b032a3 | ||
|
823dfd1f2c | ||
|
8687714c90 |
5
.gitignore
vendored
5
.gitignore
vendored
@ -33,7 +33,4 @@
|
||||
/libgit2-0.28.2.tar.gz
|
||||
/libgit2-0.28.3.tar.gz
|
||||
/libgit2-0.28.4.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
|
||||
/libgit2-0.28.5.tar.gz
|
||||
|
@ -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
|
||||
|
75
libgit2.spec
75
libgit2.spec
@ -1,31 +1,22 @@
|
||||
# libssh2 is not available on RHEL
|
||||
%if 0%{?rhel}
|
||||
%bcond_with libssh2
|
||||
%else
|
||||
%bcond_without libssh2
|
||||
%endif
|
||||
|
||||
Name: libgit2
|
||||
Version: 1.1.0
|
||||
Release: 6%{?dist}
|
||||
Version: 0.28.5
|
||||
Release: 1%{?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 >= 3.5.1
|
||||
BuildRequires: cmake >= 2.8.11
|
||||
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
|
||||
@ -36,6 +27,7 @@ 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
|
||||
@ -48,23 +40,17 @@ developing applications that use %{name}.
|
||||
find examples -name ".gitignore" -delete -print
|
||||
|
||||
# Don't run "online" tests
|
||||
sed -i '/-sonline/s/^/#/' tests/CMakeLists.txt
|
||||
sed -i '/ADD_TEST(online/s/^/#/' tests/CMakeLists.txt
|
||||
|
||||
# Remove bundled libraries
|
||||
rm -vr deps
|
||||
rm -frv deps
|
||||
|
||||
%build
|
||||
%cmake . -B%{_target_platform} \
|
||||
-GNinja \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DREGEX_BACKEND=pcre2 \
|
||||
-DUSE_HTTP_PARSER=system \
|
||||
-DUSE_SHA1=HTTPS \
|
||||
-DSHA1_BACKEND=OpenSSL \
|
||||
-DUSE_HTTPS=OpenSSL \
|
||||
-DUSE_NTLMCLIENT=OFF \
|
||||
%if %{without libssh2}
|
||||
-DUSE_SSH=OFF \
|
||||
%endif
|
||||
%{nil}
|
||||
%ninja_build -C %{_target_platform}
|
||||
|
||||
@ -86,47 +72,14 @@ rm -vr deps
|
||||
%{_includedir}/git2/
|
||||
|
||||
%changelog
|
||||
* Tue Sep 14 2021 Sahana Prasad <sahana@redhat.com> - 1.1.0-6
|
||||
- Rebuilt with OpenSSL 3.0.0
|
||||
* Wed Apr 01 2020 Pete Walter <pwalter@fedoraproject.org> - 0.28.5-1
|
||||
- Update to 0.28.5
|
||||
|
||||
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||
* Thu Mar 19 2020 Pete Walter <pwalter@fedoraproject.org> - 0.28.4-3
|
||||
- Rebuild against http-parser 2.9.3 (#1814897)
|
||||
|
||||
* 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
|
||||
* Sun Mar 15 2020 Pete Walter <pwalter@fedoraproject.org> - 0.28.4-2
|
||||
- Bump libgit2_0.28 obsoletes versions
|
||||
|
||||
* Wed Dec 11 09:00:52 CET 2019 Igor Gnatenko <ingnatenkobrain@fedoraproject.org> - 0.28.4-1
|
||||
- Update to 0.28.4
|
||||
|
2
sources
2
sources
@ -1 +1 @@
|
||||
SHA512 (libgit2-1.1.0.tar.gz) = 347bb68900181b44fa58a0417506c91383adb965607fce049a5b4c57ac9cc286e0a140d164c339b50fb6cd6951f47757c2917a2df44ba004bfaa4fb643946bb8
|
||||
SHA512 (libgit2-0.28.5.tar.gz) = abfea885f46444b0304ae57c32c06f4252afb0093c924da5e1ba10aaed952824d1b84036adb79b5b8ad8bea56a6331a51c62f3b9839aead16c7b26cb4554b53a
|
||||
|
Loading…
Reference in New Issue
Block a user