Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
e16f348ab1 | ||
|
a42969342f | ||
|
9642d1a969 | ||
|
b8681828d9 | ||
|
60426eb85c | ||
|
04872ae579 | ||
|
e62c539ed5 | ||
|
120fe87648 | ||
|
a25515cceb | ||
|
e3151b3f27 | ||
|
f37fab884c |
5
.gitignore
vendored
5
.gitignore
vendored
@ -33,4 +33,7 @@
|
|||||||
/libgit2-0.28.2.tar.gz
|
/libgit2-0.28.2.tar.gz
|
||||||
/libgit2-0.28.3.tar.gz
|
/libgit2-0.28.3.tar.gz
|
||||||
/libgit2-0.28.4.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
|
||||||
|
@ -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
|
||||||
|
|
75
libgit2.spec
75
libgit2.spec
@ -1,22 +1,31 @@
|
|||||||
|
# libssh2 is not available on RHEL
|
||||||
|
%if 0%{?rhel}
|
||||||
|
%bcond_with libssh2
|
||||||
|
%else
|
||||||
|
%bcond_without libssh2
|
||||||
|
%endif
|
||||||
|
|
||||||
Name: libgit2
|
Name: libgit2
|
||||||
Version: 0.28.5
|
Version: 1.1.0
|
||||||
Release: 1%{?dist}
|
Release: 6%{?dist}
|
||||||
Summary: C implementation of the Git core methods as a library with a solid API
|
Summary: C implementation of the Git core methods as a library with a solid API
|
||||||
License: GPLv2 with exceptions
|
License: GPLv2 with exceptions
|
||||||
URL: https://libgit2.org/
|
URL: https://libgit2.org/
|
||||||
Source0: https://github.com/libgit2/libgit2/archive/v%{version}/%{name}-%{version}.tar.gz
|
Source0: https://github.com/libgit2/libgit2/archive/v%{version}/%{name}-%{version}.tar.gz
|
||||||
|
|
||||||
BuildRequires: gcc
|
BuildRequires: gcc
|
||||||
BuildRequires: cmake >= 2.8.11
|
BuildRequires: cmake >= 3.5.1
|
||||||
BuildRequires: ninja-build
|
BuildRequires: ninja-build
|
||||||
BuildRequires: http-parser-devel
|
BuildRequires: http-parser-devel
|
||||||
BuildRequires: libcurl-devel
|
BuildRequires: libcurl-devel
|
||||||
|
%if %{with libssh2}
|
||||||
BuildRequires: libssh2-devel
|
BuildRequires: libssh2-devel
|
||||||
|
%endif
|
||||||
BuildRequires: openssl-devel
|
BuildRequires: openssl-devel
|
||||||
|
BuildRequires: pcre2-devel
|
||||||
BuildRequires: python3
|
BuildRequires: python3
|
||||||
BuildRequires: zlib-devel
|
BuildRequires: zlib-devel
|
||||||
Provides: bundled(libxdiff)
|
Provides: bundled(libxdiff)
|
||||||
Obsoletes: libgit2_0.28 < 0.28.4-2
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
libgit2 is a portable, pure C implementation of the Git core methods
|
libgit2 is a portable, pure C implementation of the Git core methods
|
||||||
@ -27,7 +36,6 @@ with bindings.
|
|||||||
%package devel
|
%package devel
|
||||||
Summary: Development files for %{name}
|
Summary: Development files for %{name}
|
||||||
Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
|
Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||||
Obsoletes: libgit2_0.28-devel < 0.28.4-2
|
|
||||||
|
|
||||||
%description devel
|
%description devel
|
||||||
This package contains libraries and header files for
|
This package contains libraries and header files for
|
||||||
@ -40,17 +48,23 @@ developing applications that use %{name}.
|
|||||||
find examples -name ".gitignore" -delete -print
|
find examples -name ".gitignore" -delete -print
|
||||||
|
|
||||||
# Don't run "online" tests
|
# Don't run "online" tests
|
||||||
sed -i '/ADD_TEST(online/s/^/#/' tests/CMakeLists.txt
|
sed -i '/-sonline/s/^/#/' tests/CMakeLists.txt
|
||||||
|
|
||||||
# Remove bundled libraries
|
# Remove bundled libraries
|
||||||
rm -frv deps
|
rm -vr deps
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%cmake . -B%{_target_platform} \
|
%cmake . -B%{_target_platform} \
|
||||||
-GNinja \
|
-GNinja \
|
||||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||||
-DSHA1_BACKEND=OpenSSL \
|
-DREGEX_BACKEND=pcre2 \
|
||||||
|
-DUSE_HTTP_PARSER=system \
|
||||||
|
-DUSE_SHA1=HTTPS \
|
||||||
-DUSE_HTTPS=OpenSSL \
|
-DUSE_HTTPS=OpenSSL \
|
||||||
|
-DUSE_NTLMCLIENT=OFF \
|
||||||
|
%if %{without libssh2}
|
||||||
|
-DUSE_SSH=OFF \
|
||||||
|
%endif
|
||||||
%{nil}
|
%{nil}
|
||||||
%ninja_build -C %{_target_platform}
|
%ninja_build -C %{_target_platform}
|
||||||
|
|
||||||
@ -72,14 +86,47 @@ rm -frv deps
|
|||||||
%{_includedir}/git2/
|
%{_includedir}/git2/
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Wed Apr 01 2020 Pete Walter <pwalter@fedoraproject.org> - 0.28.5-1
|
* Tue Sep 14 2021 Sahana Prasad <sahana@redhat.com> - 1.1.0-6
|
||||||
- Update to 0.28.5
|
- Rebuilt with OpenSSL 3.0.0
|
||||||
|
|
||||||
* Thu Mar 19 2020 Pete Walter <pwalter@fedoraproject.org> - 0.28.4-3
|
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-5
|
||||||
- Rebuild against http-parser 2.9.3 (#1814897)
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||||
|
|
||||||
* Sun Mar 15 2020 Pete Walter <pwalter@fedoraproject.org> - 0.28.4-2
|
* Thu Mar 18 2021 Kamil Dudka <kdudka@redhat.com> - 1.1.0-4
|
||||||
- Bump libgit2_0.28 obsoletes versions
|
- 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
|
* Wed Dec 11 09:00:52 CET 2019 Igor Gnatenko <ingnatenkobrain@fedoraproject.org> - 0.28.4-1
|
||||||
- Update to 0.28.4
|
- Update to 0.28.4
|
||||||
|
2
sources
2
sources
@ -1 +1 @@
|
|||||||
SHA512 (libgit2-0.28.5.tar.gz) = abfea885f46444b0304ae57c32c06f4252afb0093c924da5e1ba10aaed952824d1b84036adb79b5b8ad8bea56a6331a51c62f3b9839aead16c7b26cb4554b53a
|
SHA512 (libgit2-1.1.0.tar.gz) = 347bb68900181b44fa58a0417506c91383adb965607fce049a5b4c57ac9cc286e0a140d164c339b50fb6cd6951f47757c2917a2df44ba004bfaa4fb643946bb8
|
||||||
|
Loading…
Reference in New Issue
Block a user