From 00142b6b597a62917be466dd3752a33d5d4815ba Mon Sep 17 00:00:00 2001 From: Kate Goldenring Date: Wed, 26 Jan 2022 14:14:12 -0800 Subject: [PATCH] Update libgit2 to latest upstream version 1.1.0 (#2021) Signed-off-by: Kate Goldenring --- ...oving-untracked-files-by-path-in-sub.patch | 76 ------------------- .../libgit2/libgit2.signatures.json | 2 +- SPECS-EXTENDED/libgit2/libgit2.spec | 21 ++--- cgmanifest.json | 4 +- 4 files changed, 14 insertions(+), 89 deletions(-) delete mode 100644 SPECS-EXTENDED/libgit2/0001-checkout-Fix-removing-untracked-files-by-path-in-sub.patch diff --git a/SPECS-EXTENDED/libgit2/0001-checkout-Fix-removing-untracked-files-by-path-in-sub.patch b/SPECS-EXTENDED/libgit2/0001-checkout-Fix-removing-untracked-files-by-path-in-sub.patch deleted file mode 100644 index 652da3de811..00000000000 --- a/SPECS-EXTENDED/libgit2/0001-checkout-Fix-removing-untracked-files-by-path-in-sub.patch +++ /dev/null @@ -1,76 +0,0 @@ -From d62e44cb8218840a0291fb5fbb7c5106e1e35a12 Mon Sep 17 00:00:00 2001 -From: Segev Finer -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 - diff --git a/SPECS-EXTENDED/libgit2/libgit2.signatures.json b/SPECS-EXTENDED/libgit2/libgit2.signatures.json index 7c871a5dc61..e0666f60350 100644 --- a/SPECS-EXTENDED/libgit2/libgit2.signatures.json +++ b/SPECS-EXTENDED/libgit2/libgit2.signatures.json @@ -1,5 +1,5 @@ { "Signatures": { - "libgit2-1.0.1.tar.gz": "1775427a6098f441ddbaa5bd4e9b8a043c7401e450ed761e69a415530fea81d2" + "libgit2-1.1.0.tar.gz": "da7e5864ed298b629634986b6fb194861cb7eea28ba35c488472a459f5296bb5" } } \ No newline at end of file diff --git a/SPECS-EXTENDED/libgit2/libgit2.spec b/SPECS-EXTENDED/libgit2/libgit2.spec index 203c0115e83..ec36ab5b80e 100644 --- a/SPECS-EXTENDED/libgit2/libgit2.spec +++ b/SPECS-EXTENDED/libgit2/libgit2.spec @@ -1,22 +1,19 @@ -Vendor: Microsoft Corporation -Distribution: Mariner -Name: libgit2 -Version: 1.0.1 -Release: 4%{?dist} Summary: C implementation of the Git core methods as a library with a solid API +Name: libgit2 +Version: 1.1.0 +Release: 5%{?dist} License: GPLv2 with exceptions +Vendor: Microsoft Corporation +Distribution: Mariner URL: https://libgit2.org/ Source0: https://github.com/libgit2/libgit2/archive/v%{version}/%{name}-%{version}.tar.gz -# https://github.com/extrawurst/gitui/issues/128 -# https://github.com/libgit2/libgit2/commit/d62e44cb8218840a0291fb5fbb7c5106e1e35a12 -Patch0001: 0001-checkout-Fix-removing-untracked-files-by-path-in-sub.patch -BuildRequires: gcc BuildRequires: cmake >= 3.5.1 -BuildRequires: ninja-build +BuildRequires: gcc BuildRequires: http-parser-devel BuildRequires: libcurl-devel BuildRequires: libssh2-devel +BuildRequires: ninja-build BuildRequires: openssl-devel BuildRequires: pcre2-devel BuildRequires: python3 @@ -79,6 +76,10 @@ rm -vr deps %{_includedir}/git2/ %changelog +* Tue Jan 25 2022 Kate Goldenring - 1.1.0-1 +- Update to 1.1.0 +- License verified + * Mon Nov 01 2021 Muhammad Falak - 1.0.1-4 - Remove epoch diff --git a/cgmanifest.json b/cgmanifest.json index ac68bfdad53..e80b5ea21c0 100644 --- a/cgmanifest.json +++ b/cgmanifest.json @@ -9781,8 +9781,8 @@ "type": "other", "other": { "name": "libgit2", - "version": "1.0.1", - "downloadUrl": "https://github.com/libgit2/libgit2/archive/v1.0.1/libgit2-1.0.1.tar.gz" + "version": "1.1.0", + "downloadUrl": "https://github.com/libgit2/libgit2/archive/v1.1.0/libgit2-1.1.0.tar.gz" } } },