From 98817ecb18f7cca2e46ef957b5bda5badb5d00d2 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Jan 10 2021 22:26:47 +0000 Subject: Update to latest version. --- diff --git a/.gitignore b/.gitignore index 4cfd82c..23d3c6b 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /git2r_0.25.2.tar.gz /git2r_0.26.1.tar.gz /git2r_0.27.1.tar.gz +/git2r_0.28.0.tar.gz diff --git a/0001-checkout-handle-symbolic-reference-when-checking-out.patch b/0001-checkout-handle-symbolic-reference-when-checking-out.patch deleted file mode 100644 index 299bdc4..0000000 --- a/0001-checkout-handle-symbolic-reference-when-checking-out.patch +++ /dev/null @@ -1,33 +0,0 @@ -From b7c38b4829555b1a76f8c28f74e4e735d3ee357e Mon Sep 17 00:00:00 2001 -From: Stefan Widgren -Date: Sun, 13 Dec 2020 10:40:53 +0100 -Subject: [PATCH 1/3] checkout: handle symbolic reference when checking out - previous branch - -(cherry picked from commit 5748f6a0ee64e432cbeac9c1ea1a0823d0b2ca6a) ---- - R/checkout.R | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/R/checkout.R b/R/checkout.R -index 02327622..f27b4403 100644 ---- a/R/checkout.R -+++ b/R/checkout.R -@@ -20,9 +20,12 @@ - ##' @noRd - previous_branch_name <- function(repo) { - branch <- revparse_single(repo, "@{-1}")$sha -- - branch <- sapply(references(repo), function(x) { -- ifelse(x$sha == branch, x$shorthand, NA_character_) -+ if (is.null(x$sha)) -+ return(NA_character_) -+ if (x$sha == branch) -+ return(x$shorthand) -+ NA_character_ - }) - branch <- branch[vapply(branch, Negate(is.na), logical(1))] - --- -2.30.0.rc2 - diff --git a/0002-tests-handle-comparison-between-repos-with-different.patch b/0002-tests-handle-comparison-between-repos-with-different.patch deleted file mode 100644 index 061909c..0000000 --- a/0002-tests-handle-comparison-between-repos-with-different.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 8702bef95020b884869f93b38c9f979bf957f849 Mon Sep 17 00:00:00 2001 -From: Stefan Widgren -Date: Sun, 13 Dec 2020 11:26:07 +0100 -Subject: [PATCH 2/3] tests: handle comparison between repos with different - number of references - -(cherry picked from commit b9ee5f3e82e9f1a80c3f273ffdde5738a3f2a32a) ---- - tests/pull.R | 19 ++++++++++++------- - 1 file changed, 12 insertions(+), 7 deletions(-) - -diff --git a/tests/pull.R b/tests/pull.R -index 3b201a49..358ca1ed 100644 ---- a/tests/pull.R -+++ b/tests/pull.R -@@ -1,5 +1,5 @@ - ## git2r, R bindings to the libgit2 library. --## Copyright (C) 2013-2019 The git2r contributors -+## Copyright (C) 2013-2020 The git2r contributors - ## - ## This program is free software; you can redistribute it and/or modify - ## it under the terms of the GNU General Public License, version 2, -@@ -14,7 +14,7 @@ - ## with this program; if not, write to the Free Software Foundation, Inc., - ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - --library("git2r") -+library(git2r) - - ## For debugging - sessionInfo() -@@ -93,12 +93,17 @@ stopifnot(identical(length(commits(repo_2)), 3L)) - ## since the repositories have different paths. - stopifnot(identical(length(references(repo_1)), 2L)) - ref_1 <- references(repo_1) --ref_1[[1]]$repo <- NULL --ref_1[[2]]$repo <- NULL -+lapply(seq_len(length(ref_1)), function(i) { -+ ref_1[[i]]$repo <<- NULL -+}) - ref_2 <- references(repo_2) --ref_2[[1]]$repo <- NULL --ref_2[[2]]$repo <- NULL --stopifnot(identical(ref_1, ref_2)) -+lapply(seq_len(length(ref_2)), function(i) { -+ ref_2[[i]]$repo <<- NULL -+}) -+stopifnot(identical(ref_1[["refs/heads/master"]], -+ ref_2[["refs/heads/master"]])) -+stopifnot(identical(ref_1[["refs/remotes/origin/master"]], -+ ref_2[["refs/remotes/origin/master"]])) - - ref_1 <- references(repo_1)[["refs/heads/master"]] - stopifnot(identical(ref_1$name, "refs/heads/master")) --- -2.30.0.rc2 - diff --git a/0003-diff-add-callback-to-write-diff-to-file.patch b/0003-diff-add-callback-to-write-diff-to-file.patch deleted file mode 100644 index 05ca45e..0000000 --- a/0003-diff-add-callback-to-write-diff-to-file.patch +++ /dev/null @@ -1,68 +0,0 @@ -From ddc11c9dadc939c600662d5c9fd6766e047bbaeb Mon Sep 17 00:00:00 2001 -From: Stefan Widgren -Date: Sun, 13 Dec 2020 14:18:49 +0100 -Subject: [PATCH 3/3] diff: add callback to write diff to file - -(cherry picked from commit 03fa4e639d3b83e90ef91d4ee7f5c2812e1d8590) ---- - src/git2r_diff.c | 30 +++++++++++++++++++++++++++++- - 1 file changed, 29 insertions(+), 1 deletion(-) - -diff --git a/src/git2r_diff.c b/src/git2r_diff.c -index 2eeef502..39184fb3 100644 ---- a/src/git2r_diff.c -+++ b/src/git2r_diff.c -@@ -27,6 +27,7 @@ - #include - #include - -+#include - #include - #include - -@@ -179,6 +180,33 @@ SEXP git2r_diff( - return git2r_diff_tree_to_tree(tree1, tree2, filename, &opts); - } - -+static int -+git2r_diff_print_cb( -+ const git_diff_delta *delta, -+ const git_diff_hunk *hunk, -+ const git_diff_line *line, -+ void *payload) -+{ -+ int error; -+ -+ GIT2R_UNUSED(delta); -+ GIT2R_UNUSED(hunk); -+ -+ if (line->origin == GIT_DIFF_LINE_CONTEXT || -+ line->origin == GIT_DIFF_LINE_ADDITION || -+ line->origin == GIT_DIFF_LINE_DELETION) { -+ while ((error = fputc(line->origin, (FILE *)payload)) == EINTR) -+ continue; -+ if (error == EOF) -+ return -1; -+ } -+ -+ if (fwrite(line->content, line->content_len, 1, (FILE *)payload) != 1) -+ return -1; -+ -+ return 0; -+} -+ - /** - * Create a diff between the repository index and the workdir - * directory. -@@ -244,7 +272,7 @@ SEXP git2r_diff_index_to_wd(SEXP repo, SEXP filename, git_diff_options *opts) - error = git_diff_print( - diff, - GIT_DIFF_FORMAT_PATCH, -- git_diff_print_callback__to_file_handle, -+ git2r_diff_print_cb, - fp); - - if (fp) --- -2.30.0.rc2 - diff --git a/R-git2r.spec b/R-git2r.spec index 8c5eba3..3a7341d 100644 --- a/R-git2r.spec +++ b/R-git2r.spec @@ -1,19 +1,15 @@ %global packname git2r -%global packver 0.27.1 +%global packver 0.28.0 %global rlibdir %{_libdir}/R/library Name: R-%{packname} -Version: 0.27.1 -Release: 4%{?dist} +Version: 0.28.0 +Release: 1%{?dist} Summary: Provides Access to Git Repositories License: GPLv2 URL: https://CRAN.R-project.org/package=%{packname} Source0: https://cran.r-project.org/src/contrib/%{packname}_%{packver}.tar.gz -# Fix compatibility with libgit2 1.1.x, cherry-picked from master -Patch0001: 0001-checkout-handle-symbolic-reference-when-checking-out.patch -Patch0002: 0002-tests-handle-comparison-between-repos-with-different.patch -Patch0003: 0003-diff-add-callback-to-write-diff-to-file.patch # Here's the R view of the dependencies world: # Depends: @@ -31,8 +27,8 @@ BuildRequires: R-getPass %description Interface to the 'libgit2' library, which is a pure C implementation of the -'Git' core methods. Provides access to 'Git' repositories to extract data and -running some basic 'Git' commands. +'Git' core methods. Provides access to 'Git' repositories to extract data +and running some basic 'Git' commands. %prep @@ -40,7 +36,6 @@ running some basic 'Git' commands. # Remove bundled libgit2. pushd %{packname} -%autopatch -p1 rm -r src/libgit2 sed -i '/libgit2/d' MD5 popd @@ -79,6 +74,9 @@ rm -f %{buildroot}%{rlibdir}/R.css %changelog +* Sun Jan 10 2021 Elliott Sales de Andrade - 0.28.0-1 +- Update to latest version (#1914679) + * Mon Dec 28 19:00:31 CET 2020 Igor Raits - 0.27.1-4 - Rebuild for libgit2 1.1.x diff --git a/sources b/sources index 73f8274..3c82f0b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (git2r_0.27.1.tar.gz) = c580283aaf458bb247fccbe2448527d71c9d4df534477ba4ec8c697a81a5cf43de4049867fcfc5f0cc60b17220001467a9863b4d0cf2056a60f9179e5d631439 +SHA512 (git2r_0.28.0.tar.gz) = c1ecc067c9a85f96e0631f97db279d1bdb47e067f0484a7d57ab90052a0575778305ab7e3396621a84cee892f157ee2bae0a5fe7b8e9c68d08e66eae8106c5bc