Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-pygit2 for openSUSE:Factory checked in at 2022-07-22 19:21:13 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pygit2 (Old) and /work/SRC/openSUSE:Factory/.python-pygit2.new.21925 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pygit2" Fri Jul 22 19:21:13 2022 rev:28 rq:990575 version:1.9.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pygit2/python-pygit2.changes 2022-03-26 22:32:33.326075996 +0100 +++ /work/SRC/openSUSE:Factory/.python-pygit2.new.21925/python-pygit2.changes 2022-07-22 19:21:24.368677637 +0200 @@ -1,0 +2,11 @@ +Thu Jul 21 14:44:55 UTC 2022 - Steve Kowalik <steven.kowa...@suse.com> + +- Update to 1.9.2: + * New Repository.create_commit_string(...) and + Repository.create_commit_with_signature(...) #1142 + * Linux and macOS wheels updated to libgit2 v1.4.3 + * Remove redundant line #1139 +- Add patch support-libgit-1.5.patch: + * Suppot libgit 1.5.0 + +------------------------------------------------------------------- Old: ---- pygit2-1.9.1.tar.gz New: ---- pygit2-1.9.2.tar.gz support-libgit-1.5.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pygit2.spec ++++++ --- /var/tmp/diff_new_pack.GQfCnn/_old 2022-07-22 19:21:24.868678409 +0200 +++ /var/tmp/diff_new_pack.GQfCnn/_new 2022-07-22 19:21:24.872678416 +0200 @@ -20,12 +20,14 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-pygit2 -Version: 1.9.1 +Version: 1.9.2 Release: 0 Summary: Python bindings for libgit2 License: GPL-2.0-only URL: https://github.com/libgit2/pygit2 Source: https://files.pythonhosted.org/packages/source/p/pygit2/pygit2-%{version}.tar.gz +# PATCH-FIX-UPSTREAM based on gh#libgit2/pygit2#14b1df84060ea4ab085202382e80672ec1a104e3 +Patch0: support-libgit-1.5.patch BuildRequires: %{python_module cached-property} BuildRequires: %{python_module cffi >= 1.4.0} BuildRequires: %{python_module devel} ++++++ pygit2-1.9.1.tar.gz -> pygit2-1.9.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/AUTHORS.rst new/pygit2-1.9.2/AUTHORS.rst --- old/pygit2-1.9.1/AUTHORS.rst 2022-03-22 19:03:42.490198000 +0100 +++ new/pygit2-1.9.2/AUTHORS.rst 2022-05-24 19:30:26.409273100 +0200 @@ -95,6 +95,7 @@ Jack O'Connor Jared Flatow Jeremy Heiner + Jesse P. Johnson Jiunn Haur Lim Jorge C. Leitao Jun Omae @@ -113,6 +114,7 @@ Zbigniew J??drzejewski-Szmek Zoran Zaric Adam Spiers + Alexandru Fikl Andrew Chin Andrey Trubachev Andr??s Veres-Szentkir??lyi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/CHANGELOG.rst new/pygit2-1.9.2/CHANGELOG.rst --- old/pygit2-1.9.1/CHANGELOG.rst 2022-03-22 19:01:20.823864700 +0100 +++ new/pygit2-1.9.2/CHANGELOG.rst 2022-05-24 19:37:54.913962800 +0200 @@ -1,3 +1,16 @@ +1.9.2 (2022-05-24) +------------------------- + +- New ``Repository.create_commit_string(...)`` and + ``Repository.create_commit_with_signature(...)`` + `#1142 <https://github.com/libgit2/pygit2/pull/1142>`_ + +- Linux and macOS wheels updated to libgit2 v1.4.3 + +- Remove redundant line + `#1139 <https://github.com/libgit2/pygit2/pull/1139>`_ + + 1.9.1 (2022-03-22) ------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/Makefile new/pygit2-1.9.2/Makefile --- old/pygit2-1.9.1/Makefile 2022-03-06 09:31:44.306066300 +0100 +++ new/pygit2-1.9.2/Makefile 2022-04-14 08:24:00.331925600 +0200 @@ -1,7 +1,7 @@ .PHONY: build html build: - LIBSSH2_VERSION=1.10.0 LIBGIT2_VERSION=1.4.2 sh build.sh + LIBSSH2_VERSION=1.10.0 LIBGIT2_VERSION=1.4.3 sh build.sh html: build make -C docs html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/PKG-INFO new/pygit2-1.9.2/PKG-INFO --- old/pygit2-1.9.1/PKG-INFO 2022-03-22 20:11:49.092077500 +0100 +++ new/pygit2-1.9.2/PKG-INFO 2022-05-24 22:01:01.317232600 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pygit2 -Version: 1.9.1 +Version: 1.9.2 Summary: Python bindings for libgit2. Home-page: https://github.com/libgit2/pygit2 Maintainer: J. David Ib????ez diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/build.sh new/pygit2-1.9.2/build.sh --- old/pygit2-1.9.1/build.sh 2022-03-06 09:31:18.845079200 +0100 +++ new/pygit2-1.9.2/build.sh 2022-04-23 10:00:11.739299000 +0200 @@ -25,19 +25,19 @@ # # sh build.sh # -# Build libgit2 1.4.2 (will use libssh2 if available), then build pygit2 +# Build libgit2 1.4.3 (will use libssh2 if available), then build pygit2 # inplace: # -# LIBGIT2_VERSION=1.4.2 sh build.sh +# LIBGIT2_VERSION=1.4.3 sh build.sh # -# Build libssh2 1.10.0 and libgit2 1.4.2, then build pygit2 inplace: +# Build libssh2 1.10.0 and libgit2 1.4.3, then build pygit2 inplace: # -# LIBSSH2_VERSION=1.10.0 LIBGIT2_VERSION=1.4.2 sh build.sh +# LIBSSH2_VERSION=1.10.0 LIBGIT2_VERSION=1.4.3 sh build.sh # -# Tell where libssh2 is installed, build libgit2 1.4.2, then build pygit2 +# Tell where libssh2 is installed, build libgit2 1.4.3, then build pygit2 # inplace: # -# LIBSSH2_PREFIX=/usr/local LIBGIT2_VERSION=1.4.2 sh build.sh +# LIBSSH2_PREFIX=/usr/local LIBGIT2_VERSION=1.4.3 sh build.sh # # Build inplace and run the tests: # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/pygit2/_build.py new/pygit2-1.9.2/pygit2/_build.py --- old/pygit2-1.9.1/pygit2/_build.py 2022-03-22 19:18:03.074508400 +0100 +++ new/pygit2-1.9.2/pygit2/_build.py 2022-05-24 19:31:39.134028700 +0200 @@ -35,7 +35,7 @@ # # The version number of pygit2 # -__version__ = '1.9.1' +__version__ = '1.9.2' # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/pygit2/_pygit2.pyi new/pygit2-1.9.2/pygit2/_pygit2.pyi --- old/pygit2-1.9.1/pygit2/_pygit2.pyi 2022-03-06 09:26:49.549038600 +0100 +++ new/pygit2-1.9.2/pygit2/_pygit2.pyi 2022-05-06 08:07:20.948192800 +0200 @@ -1,4 +1,4 @@ -from typing import Iterator +from typing import Iterator, Optional from io import IOBase from . import Index, Submodule @@ -459,6 +459,8 @@ def create_blob_fromworkdir(self, path: str) -> Oid: ... def create_branch(self, name: str, commit: Commit, force = False) -> Branch: ... def create_commit(self, reference_name: str, author: Signature, committer: Signature, message: str, tree: _OidArg, parents: list[_OidArg], encoding: str = ...) -> Oid: ... + def create_commit_string(self, author: Signature, committer: Signature, message: str, tree: _OidArg, parents: list[_OidArg], encoding: str = ...) -> Oid: ... + def create_commit_with_signature(self, content: str, signature: str, signature_field: Optional[str] = None) -> Oid: ... def create_note(self, message: str, author: Signature, committer: Signature, annotated_id: str, ref: str = "refs/notes/commits", force: bool = False) -> Oid: ... def create_reference_direct(self, name: str, target: _OidArg, force: bool, message: str = None) -> Reference: ... def create_reference_symbolic(self, name: str, target: str, force: bool, message: str = None) -> Reference: ... diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/pygit2/remote.py new/pygit2-1.9.2/pygit2/remote.py --- old/pygit2-1.9.1/pygit2/remote.py 2022-01-26 16:20:11.883729500 +0100 +++ new/pygit2-1.9.2/pygit2/remote.py 2022-04-26 20:55:32.101869000 +0200 @@ -137,7 +137,6 @@ * `True` to enable automatic proxy detection * an url to a proxy (`http://proxy.example.org:3128/`) """ - message = to_bytes(message) with git_fetch_options(callbacks) as payload: opts = payload.fetch_options opts.prune = prune diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/src/repository.c new/pygit2-1.9.2/src/repository.c --- old/pygit2-1.9.1/src/repository.c 2022-03-14 09:11:42.436751800 +0100 +++ new/pygit2-1.9.2/src/repository.c 2022-05-06 08:07:20.948192800 +0200 @@ -1110,6 +1110,115 @@ return py_result; } +PyDoc_STRVAR(Repository_create_commit_string__doc__, + "create_commit_string(author: Signature, committer: Signature, message: bytes | str, tree: Oid, parents: list[Oid][, encoding: str]) -> str\n" + "\n" + "Create a new commit but return it as a string."); + +PyObject * +Repository_create_commit_string(Repository *self, PyObject *args) +{ + Signature *py_author, *py_committer; + PyObject *py_oid, *py_message, *py_parents, *py_parent; + PyObject *str; + char *encoding = NULL; + git_oid oid; + git_tree *tree = NULL; + int parent_count; + git_commit **parents = NULL; + git_buf buf = { 0 }; + int i = 0; + + if (!PyArg_ParseTuple(args, "O!O!OOO!|s", + &SignatureType, &py_author, + &SignatureType, &py_committer, + &py_message, + &py_oid, + &PyList_Type, &py_parents, + &encoding)) + return NULL; + + size_t len = py_oid_to_git_oid(py_oid, &oid); + if (len == 0) + return NULL; + + PyObject *tmessage; + const char *message = pgit_borrow_encoding(py_message, encoding, NULL, &tmessage); + if (message == NULL) + return NULL; + + int err = git_tree_lookup_prefix(&tree, self->repo, &oid, len); + if (err < 0) { + Error_set(err); + goto out; + } + + parent_count = (int)PyList_Size(py_parents); + parents = malloc(parent_count * sizeof(git_commit*)); + if (parents == NULL) { + PyErr_SetNone(PyExc_MemoryError); + goto out; + } + for (; i < parent_count; i++) { + py_parent = PyList_GET_ITEM(py_parents, i); + len = py_oid_to_git_oid(py_parent, &oid); + if (len == 0) + goto out; + err = git_commit_lookup_prefix(&parents[i], self->repo, &oid, len); + if (err < 0) { + Error_set(err); + goto out; + } + } + + err = git_commit_create_buffer(&buf, self->repo, + py_author->signature, py_committer->signature, + encoding, message, tree, parent_count, + (const git_commit**)parents); + if (err < 0) { + Error_set(err); + goto out; + } + + str = to_unicode_n(buf.ptr, buf.size, NULL, NULL); + git_buf_dispose(&buf); + +out: + Py_DECREF(tmessage); + git_tree_free(tree); + while (i > 0) { + i--; + git_commit_free(parents[i]); + } + free(parents); + return str; +} + +PyDoc_STRVAR(Repository_create_commit_with_signature__doc__, + "create_commit_with_signature(content: str, signature: str, field_name: str) -> Oid\n" + "\n" + "Create a new signed commit object, return its oid."); + +PyObject * +Repository_create_commit_with_signature(Repository *self, PyObject *args) +{ + git_oid oid; + char *content, *signature; + char *signature_field = NULL; + + if (!PyArg_ParseTuple(args, "ss|s", &content, &signature, &signature_field)) + return NULL; + + int err = git_commit_create_with_signature(&oid, self->repo, content, + signature, signature_field); + + if (err < 0) { + Error_set(err); + return NULL; + } + + return git_oid_to_python(&oid); +} PyDoc_STRVAR(Repository_create_tag__doc__, "create_tag(name: str, oid: Oid, type: int, tagger: Signature[, message: str]) -> Oid\n" @@ -2277,6 +2386,8 @@ METHOD(Repository, create_blob_fromdisk, METH_VARARGS), METHOD(Repository, create_blob_fromiobase, METH_O), METHOD(Repository, create_commit, METH_VARARGS), + METHOD(Repository, create_commit_string, METH_VARARGS), + METHOD(Repository, create_commit_with_signature, METH_VARARGS), METHOD(Repository, create_tag, METH_VARARGS), METHOD(Repository, TreeBuilder, METH_VARARGS), METHOD(Repository, walk, METH_VARARGS), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/src/repository.h new/pygit2-1.9.2/src/repository.h --- old/pygit2-1.9.1/src/repository.h 2022-01-26 18:46:27.228020400 +0100 +++ new/pygit2-1.9.2/src/repository.h 2022-05-06 08:07:20.948192800 +0200 @@ -43,6 +43,8 @@ PyObject* Repository_create_blob(Repository *self, PyObject *args); PyObject* Repository_create_blob_fromdisk(Repository *self, PyObject *args); PyObject* Repository_create_commit(Repository *self, PyObject *args); +PyObject* Repository_create_commit_string(Repository *self, PyObject *args); +PyObject* Repository_create_commit_with_signature(Repository *self, PyObject *args); PyObject* Repository_create_tag(Repository *self, PyObject *args); PyObject* Repository_create_branch(Repository *self, PyObject *args); PyObject* Repository_listall_references(Repository *self, PyObject *args); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/test/conftest.py new/pygit2-1.9.2/test/conftest.py --- old/pygit2-1.9.1/test/conftest.py 2022-03-20 08:29:56.979253500 +0100 +++ new/pygit2-1.9.2/test/conftest.py 2022-05-24 19:39:04.882668700 +0200 @@ -26,58 +26,67 @@ @pytest.fixture def barerepo(tmp_path): - with utils.TemporaryRepository('testrepo.git', tmp_path) as path: + with utils.TemporaryRepository('barerepo.zip', tmp_path) as path: yield pygit2.Repository(path) @pytest.fixture def barerepo_path(tmp_path): - with utils.TemporaryRepository('testrepo.git', tmp_path) as path: + with utils.TemporaryRepository('barerepo.zip', tmp_path) as path: yield pygit2.Repository(path), path @pytest.fixture def blameflagsrepo(tmp_path): - with utils.TemporaryRepository('blameflagsrepo.tar', tmp_path) as path: + with utils.TemporaryRepository('blameflagsrepo.zip', tmp_path) as path: yield pygit2.Repository(path) @pytest.fixture def dirtyrepo(tmp_path): - with utils.TemporaryRepository('dirtyrepo.tar', tmp_path) as path: + with utils.TemporaryRepository('dirtyrepo.zip', tmp_path) as path: yield pygit2.Repository(path) @pytest.fixture -def emptyrepo(tmp_path): - with utils.TemporaryRepository('emptyrepo.tar', tmp_path) as path: - yield pygit2.Repository(path) +def emptyrepo(barerepo, tmp_path): + with utils.TemporaryRepository('emptyrepo.zip', tmp_path) as path: + repo = pygit2.Repository(path) + repo.remotes.create('origin', barerepo.path) + yield repo + @pytest.fixture def encodingrepo(tmp_path): - with utils.TemporaryRepository('encoding.tar', tmp_path) as path: + with utils.TemporaryRepository('encoding.zip', tmp_path) as path: yield pygit2.Repository(path) @pytest.fixture def mergerepo(tmp_path): - with utils.TemporaryRepository('testrepoformerging.tar', tmp_path) as path: + with utils.TemporaryRepository('testrepoformerging.zip', tmp_path) as path: yield pygit2.Repository(path) @pytest.fixture def testrepo(tmp_path): - with utils.TemporaryRepository('testrepo.tar', tmp_path) as path: + with utils.TemporaryRepository('testrepo.zip', tmp_path) as path: yield pygit2.Repository(path) @pytest.fixture def testrepo_path(tmp_path): - with utils.TemporaryRepository('testrepo.tar', tmp_path) as path: + with utils.TemporaryRepository('testrepo.zip', tmp_path) as path: yield pygit2.Repository(path), path @pytest.fixture def testrepopacked(tmp_path): - with utils.TemporaryRepository('testrepopacked.tar', tmp_path) as path: + with utils.TemporaryRepository('testrepopacked.zip', tmp_path) as path: + yield pygit2.Repository(path) + + +@pytest.fixture +def gpgsigned(tmp_path): + with utils.TemporaryRepository('gpgsigned.zip', tmp_path) as path: yield pygit2.Repository(path) Binary files old/pygit2-1.9.1/test/data/barerepo.zip and new/pygit2-1.9.2/test/data/barerepo.zip differ Binary files old/pygit2-1.9.1/test/data/binaryfilerepo.tar and new/pygit2-1.9.2/test/data/binaryfilerepo.tar differ Binary files old/pygit2-1.9.1/test/data/binaryfilerepo.zip and new/pygit2-1.9.2/test/data/binaryfilerepo.zip differ Binary files old/pygit2-1.9.1/test/data/blameflagsrepo.tar and new/pygit2-1.9.2/test/data/blameflagsrepo.tar differ Binary files old/pygit2-1.9.1/test/data/blameflagsrepo.zip and new/pygit2-1.9.2/test/data/blameflagsrepo.zip differ Binary files old/pygit2-1.9.1/test/data/dirtyrepo.tar and new/pygit2-1.9.2/test/data/dirtyrepo.tar differ Binary files old/pygit2-1.9.1/test/data/dirtyrepo.zip and new/pygit2-1.9.2/test/data/dirtyrepo.zip differ Binary files old/pygit2-1.9.1/test/data/emptyrepo.tar and new/pygit2-1.9.2/test/data/emptyrepo.tar differ Binary files old/pygit2-1.9.1/test/data/emptyrepo.zip and new/pygit2-1.9.2/test/data/emptyrepo.zip differ Binary files old/pygit2-1.9.1/test/data/encoding.tar and new/pygit2-1.9.2/test/data/encoding.tar differ Binary files old/pygit2-1.9.1/test/data/encoding.zip and new/pygit2-1.9.2/test/data/encoding.zip differ Binary files old/pygit2-1.9.1/test/data/gpgsigned.tar and new/pygit2-1.9.2/test/data/gpgsigned.tar differ Binary files old/pygit2-1.9.1/test/data/gpgsigned.zip and new/pygit2-1.9.2/test/data/gpgsigned.zip differ Binary files old/pygit2-1.9.1/test/data/submodulerepo.tar and new/pygit2-1.9.2/test/data/submodulerepo.tar differ Binary files old/pygit2-1.9.1/test/data/submodulerepo.zip and new/pygit2-1.9.2/test/data/submodulerepo.zip differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/test/data/testrepo.git/HEAD new/pygit2-1.9.2/test/data/testrepo.git/HEAD --- old/pygit2-1.9.1/test/data/testrepo.git/HEAD 2013-03-02 11:50:05.000000000 +0100 +++ new/pygit2-1.9.2/test/data/testrepo.git/HEAD 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -ref: refs/heads/master diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/test/data/testrepo.git/config new/pygit2-1.9.2/test/data/testrepo.git/config --- old/pygit2-1.9.1/test/data/testrepo.git/config 2015-01-26 18:11:50.327102400 +0100 +++ new/pygit2-1.9.2/test/data/testrepo.git/config 1970-01-01 01:00:00.000000000 +0100 @@ -1,7 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = true - editor = 'ed' -[gc] - auto = no Binary files old/pygit2-1.9.1/test/data/testrepo.git/objects/05/6e626e51b1fc1ee2182800e399ed8d84c8f082 and new/pygit2-1.9.2/test/data/testrepo.git/objects/05/6e626e51b1fc1ee2182800e399ed8d84c8f082 differ Binary files old/pygit2-1.9.1/test/data/testrepo.git/objects/10/2374bdb1e8efca5e66cded18fd8f30571654a5 and new/pygit2-1.9.2/test/data/testrepo.git/objects/10/2374bdb1e8efca5e66cded18fd8f30571654a5 differ Binary files old/pygit2-1.9.1/test/data/testrepo.git/objects/11/19926b06311143cab273f0af84eae77f5b3462 and new/pygit2-1.9.2/test/data/testrepo.git/objects/11/19926b06311143cab273f0af84eae77f5b3462 differ Binary files old/pygit2-1.9.1/test/data/testrepo.git/objects/18/e2d2e9db075f9eb43bcb2daa65a2867d29a15e and new/pygit2-1.9.2/test/data/testrepo.git/objects/18/e2d2e9db075f9eb43bcb2daa65a2867d29a15e differ Binary files old/pygit2-1.9.1/test/data/testrepo.git/objects/19/bf31524643d743751b09cf719456914bbd8bd5 and new/pygit2-1.9.2/test/data/testrepo.git/objects/19/bf31524643d743751b09cf719456914bbd8bd5 differ Binary files old/pygit2-1.9.1/test/data/testrepo.git/objects/1a/f81f24e48f92009ca02a874edb6151c71f60de and new/pygit2-1.9.2/test/data/testrepo.git/objects/1a/f81f24e48f92009ca02a874edb6151c71f60de differ Binary files old/pygit2-1.9.1/test/data/testrepo.git/objects/29/7efb891a47de80be0cfe9c639e4b8c9b450989 and new/pygit2-1.9.2/test/data/testrepo.git/objects/29/7efb891a47de80be0cfe9c639e4b8c9b450989 differ Binary files old/pygit2-1.9.1/test/data/testrepo.git/objects/2a/d1d3456c5c4a1c9e40aeeddb9cd20b409623c8 and new/pygit2-1.9.2/test/data/testrepo.git/objects/2a/d1d3456c5c4a1c9e40aeeddb9cd20b409623c8 differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/test/data/testrepo.git/objects/2c/dae28389c059815e951d0bb9eed6533f61a46b new/pygit2-1.9.2/test/data/testrepo.git/objects/2c/dae28389c059815e951d0bb9eed6533f61a46b --- old/pygit2-1.9.1/test/data/testrepo.git/objects/2c/dae28389c059815e951d0bb9eed6533f61a46b 2015-01-26 18:10:33.311656200 +0100 +++ new/pygit2-1.9.2/test/data/testrepo.git/objects/2c/dae28389c059815e951d0bb9eed6533f61a46b 1970-01-01 01:00:00.000000000 +0100 @@ -1,2 +0,0 @@ -x?OIj1?Y???A??? ?}?!??????? ~~?I^?[?PE?<7??E:3?RMu>D -????s?c?jq???u??V:/?? ?;?? ?%??H#V?~4??]???K???? ^7==?{?7??|?B?~{?\r?M??Q??H?????z?]?)????S???T?+? ??.m????E??Z}s]? \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/test/data/testrepo.git/objects/39/a3001fcc2b9541fdcf4be2d662618a5d213f47 new/pygit2-1.9.2/test/data/testrepo.git/objects/39/a3001fcc2b9541fdcf4be2d662618a5d213f47 --- old/pygit2-1.9.1/test/data/testrepo.git/objects/39/a3001fcc2b9541fdcf4be2d662618a5d213f47 2015-01-26 18:10:33.311656200 +0100 +++ new/pygit2-1.9.2/test/data/testrepo.git/objects/39/a3001fcc2b9541fdcf4be2d662618a5d213f47 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -x?O9N1$?+:G?z|?=B??|?G{m-s??????/ ?R?J??6??w"p*????Q?4'CK^??b??&/NU?G??1?B=???4)???1)???g?1?1qBn\????AWx9d}????[??!???&??F???g?E????????g` 9p??>)??c?j?.4?+????]???O???W)??M]= \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/test/data/testrepo.git/objects/3d/2962987c695a29f1f80b6c3aa4ec046ef44369 new/pygit2-1.9.2/test/data/testrepo.git/objects/3d/2962987c695a29f1f80b6c3aa4ec046ef44369 --- old/pygit2-1.9.1/test/data/testrepo.git/objects/3d/2962987c695a29f1f80b6c3aa4ec046ef44369 2013-03-02 11:50:05.000000000 +0100 +++ new/pygit2-1.9.2/test/data/testrepo.git/objects/3d/2962987c695a29f1f80b6c3aa4ec046ef44369 1970-01-01 01:00:00.000000000 +0100 @@ -1,2 +0,0 @@ -x-?A -?0@Q?9?\???m?@????$T,#eP????????????A????H%a???:????`{B???l?%???<Ojt5?-*/pKo??,???C??T???f???0?m??h???Z9o?.7?yP1? \ No newline at end of file Binary files old/pygit2-1.9.1/test/data/testrepo.git/objects/55/60f04f38a674decf34d16d7c7476642fa03794 and new/pygit2-1.9.2/test/data/testrepo.git/objects/55/60f04f38a674decf34d16d7c7476642fa03794 differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/test/data/testrepo.git/objects/5f/e808e8953c12735680c257f56600cb0de44b10 new/pygit2-1.9.2/test/data/testrepo.git/objects/5f/e808e8953c12735680c257f56600cb0de44b10 --- old/pygit2-1.9.1/test/data/testrepo.git/objects/5f/e808e8953c12735680c257f56600cb0de44b10 2013-03-02 11:50:05.000000000 +0100 +++ new/pygit2-1.9.2/test/data/testrepo.git/objects/5f/e808e8953c12735680c257f56600cb0de44b10 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -x??[j?0?~{??[N??R???Pdy??%Qt? 4????s?e?0???@???Rsd?."?HC?V??P]?8:4?????3r%L?$xt???F????b?eC:? ^?S????5?<??<?o????q[??aJ}?>x????=?T??On????U??Tv?BJ????6???`???P)??m??A??3??X]f \ No newline at end of file Binary files old/pygit2-1.9.1/test/data/testrepo.git/objects/61/4fd9a3094bf618ea938fffc00e7d1a54f89ad0 and new/pygit2-1.9.2/test/data/testrepo.git/objects/61/4fd9a3094bf618ea938fffc00e7d1a54f89ad0 differ Binary files old/pygit2-1.9.1/test/data/testrepo.git/objects/62/cc88a53cfb046fcf603b3aaeb73b8e18215442 and new/pygit2-1.9.2/test/data/testrepo.git/objects/62/cc88a53cfb046fcf603b3aaeb73b8e18215442 differ Binary files old/pygit2-1.9.1/test/data/testrepo.git/objects/63/59f8019b0954201a807b766547526173f3cc67 and new/pygit2-1.9.2/test/data/testrepo.git/objects/63/59f8019b0954201a807b766547526173f3cc67 differ Binary files old/pygit2-1.9.1/test/data/testrepo.git/objects/6a/270c81bc80b59591e0d2e3abd7d03450c0c395 and new/pygit2-1.9.2/test/data/testrepo.git/objects/6a/270c81bc80b59591e0d2e3abd7d03450c0c395 differ Binary files old/pygit2-1.9.1/test/data/testrepo.git/objects/72/abb8755b2cc6c4e40fd9f50f54384d973a2f22 and new/pygit2-1.9.2/test/data/testrepo.git/objects/72/abb8755b2cc6c4e40fd9f50f54384d973a2f22 differ Binary files old/pygit2-1.9.1/test/data/testrepo.git/objects/77/88019febe4f40259a64c529a9aed561e64ddbd and new/pygit2-1.9.2/test/data/testrepo.git/objects/77/88019febe4f40259a64c529a9aed561e64ddbd differ Binary files old/pygit2-1.9.1/test/data/testrepo.git/objects/78/4855caf26449a1914d2cf62d12b9374d76ae78 and new/pygit2-1.9.2/test/data/testrepo.git/objects/78/4855caf26449a1914d2cf62d12b9374d76ae78 differ Binary files old/pygit2-1.9.1/test/data/testrepo.git/objects/7f/129fd57e31e935c6d60a0c794efe4e6927664b and new/pygit2-1.9.2/test/data/testrepo.git/objects/7f/129fd57e31e935c6d60a0c794efe4e6927664b differ Binary files old/pygit2-1.9.1/test/data/testrepo.git/objects/96/7fce8df97cc71722d3c2a5930ef3e6f1d27b12 and new/pygit2-1.9.2/test/data/testrepo.git/objects/96/7fce8df97cc71722d3c2a5930ef3e6f1d27b12 differ Binary files old/pygit2-1.9.1/test/data/testrepo.git/objects/97/d615e1bc273c40c94a726814e7b93fdb5a1b36 and new/pygit2-1.9.2/test/data/testrepo.git/objects/97/d615e1bc273c40c94a726814e7b93fdb5a1b36 differ Binary files old/pygit2-1.9.1/test/data/testrepo.git/objects/a0/75f5a7394b0838a9f54dfc511e1a3fbbb3b973 and new/pygit2-1.9.2/test/data/testrepo.git/objects/a0/75f5a7394b0838a9f54dfc511e1a3fbbb3b973 differ Binary files old/pygit2-1.9.1/test/data/testrepo.git/objects/ab/533997b80705767be3dae8cbb06a0740809f79 and new/pygit2-1.9.2/test/data/testrepo.git/objects/ab/533997b80705767be3dae8cbb06a0740809f79 differ Binary files old/pygit2-1.9.1/test/data/testrepo.git/objects/c2/c2f6b06efdb6c1e4b1337811f0629fc0cadbd1 and new/pygit2-1.9.2/test/data/testrepo.git/objects/c2/c2f6b06efdb6c1e4b1337811f0629fc0cadbd1 differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/test/data/testrepo.git/objects/cc/ca47fbb26183e71a7a46d165299b84e2e6c0b3 new/pygit2-1.9.2/test/data/testrepo.git/objects/cc/ca47fbb26183e71a7a46d165299b84e2e6c0b3 --- old/pygit2-1.9.1/test/data/testrepo.git/objects/cc/ca47fbb26183e71a7a46d165299b84e2e6c0b3 2015-01-26 18:11:50.330435800 +0100 +++ new/pygit2-1.9.2/test/data/testrepo.git/objects/cc/ca47fbb26183e71a7a46d165299b84e2e6c0b3 1970-01-01 01:00:00.000000000 +0100 @@ -1,2 +0,0 @@ -x??[j?0D??U??B?#?%(%[???[ -?????Iw???9?????>?? a?"I????????0?6?Ilb?????b??.??}?I???9?ss0|Y??X?N??[}<?V???z??|m\?S??'?M?:M????Z?qr???bb?/u???\@<h, 4?>??Z??mS? \ No newline at end of file Binary files old/pygit2-1.9.1/test/data/testrepo.git/objects/d8/79714d880671ed84f8aaed8b27fca23ba01f27 and new/pygit2-1.9.2/test/data/testrepo.git/objects/d8/79714d880671ed84f8aaed8b27fca23ba01f27 differ Binary files old/pygit2-1.9.1/test/data/testrepo.git/objects/f5/e5aa4e36ab0fe62ee1ccc6eb8f79b866863b87 and new/pygit2-1.9.2/test/data/testrepo.git/objects/f5/e5aa4e36ab0fe62ee1ccc6eb8f79b866863b87 differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/test/data/testrepo.git/objects/info/packs new/pygit2-1.9.2/test/data/testrepo.git/objects/info/packs --- old/pygit2-1.9.1/test/data/testrepo.git/objects/info/packs 2013-03-02 11:50:05.000000000 +0100 +++ new/pygit2-1.9.2/test/data/testrepo.git/objects/info/packs 1970-01-01 01:00:00.000000000 +0100 @@ -1,2 +0,0 @@ -P pack-822653eb59791a6df714f8aa5fbf9f1c1951478e.pack - Binary files old/pygit2-1.9.1/test/data/testrepo.git/objects/pack/pack-822653eb59791a6df714f8aa5fbf9f1c1951478e.idx and new/pygit2-1.9.2/test/data/testrepo.git/objects/pack/pack-822653eb59791a6df714f8aa5fbf9f1c1951478e.idx differ Binary files old/pygit2-1.9.1/test/data/testrepo.git/objects/pack/pack-822653eb59791a6df714f8aa5fbf9f1c1951478e.pack and new/pygit2-1.9.2/test/data/testrepo.git/objects/pack/pack-822653eb59791a6df714f8aa5fbf9f1c1951478e.pack differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/test/data/testrepo.git/packed-refs new/pygit2-1.9.2/test/data/testrepo.git/packed-refs --- old/pygit2-1.9.1/test/data/testrepo.git/packed-refs 2013-03-02 11:50:05.000000000 +0100 +++ new/pygit2-1.9.2/test/data/testrepo.git/packed-refs 1970-01-01 01:00:00.000000000 +0100 @@ -1,2 +0,0 @@ -# pack-refs with: peeled -c2792cfa289ae6321ecf2cd5806c2194b0fd070c refs/heads/master diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/test/data/testrepo.git/refs/heads/master new/pygit2-1.9.2/test/data/testrepo.git/refs/heads/master --- old/pygit2-1.9.1/test/data/testrepo.git/refs/heads/master 2015-01-26 18:11:50.330435800 +0100 +++ new/pygit2-1.9.2/test/data/testrepo.git/refs/heads/master 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -784855caf26449a1914d2cf62d12b9374d76ae78 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/test/data/testrepo.git/refs/notes/commits new/pygit2-1.9.2/test/data/testrepo.git/refs/notes/commits --- old/pygit2-1.9.1/test/data/testrepo.git/refs/notes/commits 2015-01-26 18:11:50.330435800 +0100 +++ new/pygit2-1.9.2/test/data/testrepo.git/refs/notes/commits 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -a075f5a7394b0838a9f54dfc511e1a3fbbb3b973 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/test/data/testrepo.git/refs/tags/root new/pygit2-1.9.2/test/data/testrepo.git/refs/tags/root --- old/pygit2-1.9.1/test/data/testrepo.git/refs/tags/root 2013-03-02 11:50:05.000000000 +0100 +++ new/pygit2-1.9.2/test/data/testrepo.git/refs/tags/root 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -3d2962987c695a29f1f80b6c3aa4ec046ef44369 Binary files old/pygit2-1.9.1/test/data/testrepo.tar and new/pygit2-1.9.2/test/data/testrepo.tar differ Binary files old/pygit2-1.9.1/test/data/testrepo.zip and new/pygit2-1.9.2/test/data/testrepo.zip differ Binary files old/pygit2-1.9.1/test/data/testrepoformerging.tar and new/pygit2-1.9.2/test/data/testrepoformerging.tar differ Binary files old/pygit2-1.9.1/test/data/testrepoformerging.zip and new/pygit2-1.9.2/test/data/testrepoformerging.zip differ Binary files old/pygit2-1.9.1/test/data/testrepopacked.tar and new/pygit2-1.9.2/test/data/testrepopacked.tar differ Binary files old/pygit2-1.9.1/test/data/testrepopacked.zip and new/pygit2-1.9.2/test/data/testrepopacked.zip differ Binary files old/pygit2-1.9.1/test/data/trailerrepo.tar and new/pygit2-1.9.2/test/data/trailerrepo.tar differ Binary files old/pygit2-1.9.1/test/data/trailerrepo.zip and new/pygit2-1.9.2/test/data/trailerrepo.zip differ Binary files old/pygit2-1.9.1/test/data/utf8branchrepo.tar and new/pygit2-1.9.2/test/data/utf8branchrepo.tar differ Binary files old/pygit2-1.9.1/test/data/utf8branchrepo.zip and new/pygit2-1.9.2/test/data/utf8branchrepo.zip differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/test/test_commit_gpg.py new/pygit2-1.9.2/test/test_commit_gpg.py --- old/pygit2-1.9.1/test/test_commit_gpg.py 2021-09-17 13:25:20.011411700 +0200 +++ new/pygit2-1.9.2/test/test_commit_gpg.py 2022-05-06 08:07:20.950192700 +0200 @@ -1,4 +1,4 @@ -# Copyright 2010-2021 The pygit2 contributors +# Copyright 2010-2022 The pygit2 contributors # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, @@ -23,49 +23,120 @@ # the Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. -import pygit2 -import pytest +from pygit2 import GIT_OBJ_COMMIT, Oid, Signature -from . import utils - - -@pytest.fixture -def repo(tmp_path): - with utils.TemporaryRepository('gpgsigned.tar', tmp_path) as path: - yield pygit2.Repository(path) - - -def test_get_gpg_signature_when_signed(repo): - signed_hash = 'a00b212d5455ad8c4c1779f778c7d2a81bb5da23' - expected_signature = ( - '-----BEGIN PGP SIGNATURE-----\n\n' - 'iQFGBAABCgAwFiEEQZu9JtePgJbDk7VC0+mlK74z13oFAlpzXykSHG1hcmtAbWFy\n' - 'a2FkYW1zLm1lAAoJENPppSu+M9d6FRoIAJXeQRRT1V47nnHITiel6426loYkeij7\n' - '66doGNIyll95H92SwH4LAjPyEEByIG1VsA6NztzUoNgnEvAXI0iAz3LyI7N16M4b\n' - 'dPDkC72pp8tu280H5Qt5b2V5hmlKKSgtOS5iNhdU/FbWVS8MlHsqzQTZfoTdi6ch\n' - 'KWUsjzudVd3F/H/AU+1Jsxt8Iz/oK4T/puUQLnJZKjKlljGP994FA3JIpnZpZmbG\n' - 'FybYJEDXnng7uhx3Fz/Mo3KBJoQfAExTtaToY0n0hSjOe6GN9rEsRSMK3mWdysf2\n' - 'wOdtYMMcT16hG5tAwnD/myZ4rIIpyZJ/9mjymdUsj6UKf7D+vJuqfsI=\n=IyYy\n' - '-----END PGP SIGNATURE-----' - ).encode('ascii') - - expected_payload = ( - 'tree c36c20831e43e5984c672a714661870b67ab1d95\nauthor Mark Adams ' - '<mad...@atlassian.com> 1517510299 -0600\ncommitter Mark Adams <ma' - 'd...@atlassian.com> 1517510441 -0600\n\nMaking a GPG signed commi' - 't\n' - ).encode('ascii') - - commit = repo.get(signed_hash) +content = """\ +tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904 +parent 8496071c1b46c854b31185ea97743be6a8774479 +author Ben Burkert <b...@benburkert.com> 1358451456 -0800 +committer Ben Burkert <b...@benburkert.com> 1358451456 -0800 + +a simple commit which works\ +""" + +gpgsig = """\ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.12 (Darwin) + +iQIcBAABAgAGBQJQ+FMIAAoJEH+LfPdZDSs1e3EQAJMjhqjWF+WkGLHju7pTw2al +o6IoMAhv0Z/LHlWhzBd9e7JeCnanRt12bAU7yvYp9+Z+z+dbwqLwDoFp8LVuigl8 +JGLcnwiUW3rSvhjdCp9irdb4+bhKUnKUzSdsR2CK4/hC0N2i/HOvMYX+BRsvqweq +AsAkA6dAWh+gAfedrBUkCTGhlNYoetjdakWqlGL1TiKAefEZrtA1TpPkGn92vbLq +SphFRUY9hVn1ZBWrT3hEpvAIcZag3rTOiRVT1X1flj8B2vGCEr3RrcwOIZikpdaW +who/X3xh/DGbI2RbuxmmJpxxP/8dsVchRJJzBwG+yhwU/iN3MlV2c5D69tls/Dok +6VbyU4lm/ae0y3yR83D9dUlkycOnmmlBAHKIZ9qUts9X7mWJf0+yy2QxJVpjaTGG +cmnQKKPeNIhGJk2ENnnnzjEve7L7YJQF6itbx5VCOcsGh3Ocb3YR7DMdWjt7f8pu +c6j+q1rP7EpE2afUN/geSlp5i3x8aXZPDj67jImbVCE/Q1X9voCtyzGJH7MXR0N9 +ZpRF8yzveRfMH8bwAJjSOGAFF5XkcR/RNY95o+J+QcgBLdX48h+ZdNmUf6jqlu3J +7KmTXXQcOVpN6dD3CmRFsbjq+x6RHwa8u1iGn+oIkX908r97ckfB/kHKH7ZdXIJc +cpxtDQQMGYFpXK/71stq +=ozeK +-----END PGP SIGNATURE-----\ +""" + +gpgsig_content = """\ +tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904 +parent 8496071c1b46c854b31185ea97743be6a8774479 +author Ben Burkert <b...@benburkert.com> 1358451456 -0800 +committer Ben Burkert <b...@benburkert.com> 1358451456 -0800 +gpgsig -----BEGIN PGP SIGNATURE----- + Version: GnuPG v1.4.12 (Darwin) + + iQIcBAABAgAGBQJQ+FMIAAoJEH+LfPdZDSs1e3EQAJMjhqjWF+WkGLHju7pTw2al + o6IoMAhv0Z/LHlWhzBd9e7JeCnanRt12bAU7yvYp9+Z+z+dbwqLwDoFp8LVuigl8 + JGLcnwiUW3rSvhjdCp9irdb4+bhKUnKUzSdsR2CK4/hC0N2i/HOvMYX+BRsvqweq + AsAkA6dAWh+gAfedrBUkCTGhlNYoetjdakWqlGL1TiKAefEZrtA1TpPkGn92vbLq + SphFRUY9hVn1ZBWrT3hEpvAIcZag3rTOiRVT1X1flj8B2vGCEr3RrcwOIZikpdaW + who/X3xh/DGbI2RbuxmmJpxxP/8dsVchRJJzBwG+yhwU/iN3MlV2c5D69tls/Dok + 6VbyU4lm/ae0y3yR83D9dUlkycOnmmlBAHKIZ9qUts9X7mWJf0+yy2QxJVpjaTGG + cmnQKKPeNIhGJk2ENnnnzjEve7L7YJQF6itbx5VCOcsGh3Ocb3YR7DMdWjt7f8pu + c6j+q1rP7EpE2afUN/geSlp5i3x8aXZPDj67jImbVCE/Q1X9voCtyzGJH7MXR0N9 + ZpRF8yzveRfMH8bwAJjSOGAFF5XkcR/RNY95o+J+QcgBLdX48h+ZdNmUf6jqlu3J + 7KmTXXQcOVpN6dD3CmRFsbjq+x6RHwa8u1iGn+oIkX908r97ckfB/kHKH7ZdXIJc + cpxtDQQMGYFpXK/71stq + =ozeK + -----END PGP SIGNATURE----- + +a simple commit which works\ +""" +# NOTE: ^^^ mind the gap (space must exist after GnuPG header) ^^^ +# XXX: seems macos wants the space while linux does not + + +def test_commit_signing(gpgsigned): + repo = gpgsigned + message = "a simple commit which works" + author = Signature( + name="Ben Burkert", + email="b...@benburkert.com", + time=1358451456, + offset=-480, + ) + committer = Signature( + name="Ben Burkert", + email="b...@benburkert.com", + time=1358451456, + offset=-480, + ) + tree = "4b825dc642cb6eb9a060e54bf8d69288fbee4904" + parents = ["8496071c1b46c854b31185ea97743be6a8774479"] + + # create commit string + commit_string = repo.create_commit_string( + author, committer, message, tree, parents + ) + assert commit_string == content + + # create/retrieve signed commit + oid = repo.create_commit_with_signature(content, gpgsig) + commit = repo.get(oid) signature, payload = commit.gpg_signature - assert signature == expected_signature - assert payload == expected_payload + # validate signed commit + assert content == payload.decode("utf-8") + assert gpgsig == signature.decode("utf-8") + assert gpgsig_content == commit.read_raw().decode("utf-8") + + # perform sanity checks + assert GIT_OBJ_COMMIT == commit.type + assert "6569fdf71dbd99081891154641869c537784a3ba" == commit.hex + assert commit.message_encoding is None + assert message == commit.message + assert 1358451456 == commit.commit_time + assert committer == commit.committer + assert author == commit.author + assert tree == commit.tree.hex + assert Oid(hex=tree) == commit.tree_id + assert 1 == len(commit.parents) + assert parents[0] == commit.parents[0].hex + assert Oid(hex=parents[0]) == commit.parent_ids[0] + +def test_get_gpg_signature_when_unsigned(gpgsigned): + unhash = "5b5b025afb0b4c913b4c338a42934a3863bf3644" -def test_get_gpg_signature_when_unsigned(repo): - unsigned_hash = 'a84938d1d885e80dae24b86b06621cec47ff6edd' - commit = repo.get(unsigned_hash) + repo = gpgsigned + commit = repo.get(unhash) signature, payload = commit.gpg_signature assert signature is None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/test/test_commit_trailer.py new/pygit2-1.9.2/test/test_commit_trailer.py --- old/pygit2-1.9.1/test/test_commit_trailer.py 2021-10-31 09:03:08.201437000 +0100 +++ new/pygit2-1.9.2/test/test_commit_trailer.py 2022-04-23 18:14:30.409124900 +0200 @@ -31,7 +31,7 @@ @pytest.fixture def repo(tmp_path): - with utils.TemporaryRepository('trailerrepo.tar', tmp_path) as path: + with utils.TemporaryRepository('trailerrepo.zip', tmp_path) as path: yield pygit2.Repository(path) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/test/test_diff_binary.py new/pygit2-1.9.2/test/test_diff_binary.py --- old/pygit2-1.9.1/test/test_diff_binary.py 2021-09-17 13:25:20.011411700 +0200 +++ new/pygit2-1.9.2/test/test_diff_binary.py 2022-04-23 18:14:30.409124900 +0200 @@ -31,7 +31,7 @@ @pytest.fixture def repo(tmp_path): - with utils.TemporaryRepository('binaryfilerepo.tar', tmp_path) as path: + with utils.TemporaryRepository('binaryfilerepo.zip', tmp_path) as path: yield pygit2.Repository(path) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/test/test_index.py new/pygit2-1.9.2/test/test_index.py --- old/pygit2-1.9.1/test/test_index.py 2022-03-20 09:26:12.830957700 +0100 +++ new/pygit2-1.9.2/test/test_index.py 2022-04-23 18:14:30.410124800 +0200 @@ -214,7 +214,7 @@ def test_write_tree_to(testrepo, tmp_path): pygit2.option(pygit2.GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, False) - with utils.TemporaryRepository('emptyrepo.tar', tmp_path) as path: + with utils.TemporaryRepository('emptyrepo.zip', tmp_path) as path: nrepo = Repository(path) id = testrepo.index.write_tree(nrepo) assert nrepo[id] is not None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/test/test_odb.py new/pygit2-1.9.2/test/test_odb.py --- old/pygit2-1.9.1/test/test_odb.py 2022-03-20 09:28:44.478738300 +0100 +++ new/pygit2-1.9.2/test/test_odb.py 2022-05-05 16:36:05.882153000 +0200 @@ -42,12 +42,12 @@ BLOB_OID = Oid(raw=BLOB_RAW) -def test_emptyodb(): +def test_emptyodb(barerepo): odb = Odb() assert len([str(o) for o in odb]) == 0 assert BLOB_HEX not in odb - path = Path(__file__).parent / 'data' / 'testrepo.git' / 'objects' + path = Path(barerepo.path) / 'objects' odb.add_disk_alternate(path) assert BLOB_HEX in odb diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/test/test_odb_backend.py new/pygit2-1.9.2/test/test_odb_backend.py --- old/pygit2-1.9.1/test/test_odb_backend.py 2022-03-20 09:31:34.864454000 +0100 +++ new/pygit2-1.9.2/test/test_odb_backend.py 2022-05-05 16:36:05.882153000 +0200 @@ -43,7 +43,7 @@ @pytest.fixture def odb(barerepo): - yield barerepo.odb, Path(__file__).parent / 'data' / 'testrepo.git' / 'objects' + yield barerepo.odb, Path(barerepo.path) / 'objects' def test_pack(odb): @@ -98,7 +98,7 @@ @pytest.fixture def proxy(barerepo): - path = Path(__file__).parent / 'data' / 'testrepo.git' / 'objects' + path = Path(barerepo.path) / 'objects' yield ProxyBackend(pygit2.OdbBackendPack(path)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/test/test_packbuilder.py new/pygit2-1.9.2/test/test_packbuilder.py --- old/pygit2-1.9.1/test/test_packbuilder.py 2022-03-20 09:43:57.111059400 +0100 +++ new/pygit2-1.9.2/test/test_packbuilder.py 2022-04-23 18:14:30.410124800 +0200 @@ -80,7 +80,7 @@ def setup_second_repo(tmp_path): # helper method to set up a second repo for comparison tmp_path_2 = tmp_path / 'test_repo2' - with utils.TemporaryRepository('testrepo.tar', tmp_path_2) as path: + with utils.TemporaryRepository('testrepo.zip', tmp_path_2) as path: testrepo = pygit2.Repository(path) return testrepo diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/test/test_remote.py new/pygit2-1.9.2/test/test_remote.py --- old/pygit2-1.9.1/test/test_remote.py 2022-03-19 11:47:20.565374000 +0100 +++ new/pygit2-1.9.2/test/test_remote.py 2022-05-05 16:36:05.882153000 +0200 @@ -240,14 +240,14 @@ @pytest.fixture def origin(tmp_path): - with utils.TemporaryRepository('testrepo.git', tmp_path) as path: + with utils.TemporaryRepository('barerepo.zip', tmp_path) as path: yield pygit2.Repository(path) @pytest.fixture def clone(tmp_path): clone = tmp_path / 'clone' clone.mkdir() - with utils.TemporaryRepository('testrepo.git', clone) as path: + with utils.TemporaryRepository('barerepo.zip', clone) as path: yield pygit2.Repository(path) @pytest.fixture diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/test/test_remote_utf8.py new/pygit2-1.9.2/test/test_remote_utf8.py --- old/pygit2-1.9.1/test/test_remote_utf8.py 2021-09-17 13:25:20.015411900 +0200 +++ new/pygit2-1.9.2/test/test_remote_utf8.py 2022-04-23 18:14:30.410124800 +0200 @@ -30,7 +30,7 @@ @pytest.fixture def repo(tmp_path): - with utils.TemporaryRepository('utf8branchrepo.tar', tmp_path) as path: + with utils.TemporaryRepository('utf8branchrepo.zip', tmp_path) as path: yield pygit2.Repository(path) def test_fetch(repo): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/test/test_repository.py new/pygit2-1.9.2/test/test_repository.py --- old/pygit2-1.9.1/test/test_repository.py 2022-03-20 21:45:43.136061200 +0100 +++ new/pygit2-1.9.2/test/test_repository.py 2022-05-05 16:36:05.882153000 +0200 @@ -356,42 +356,30 @@ assert discover_repository(tempfile.tempdir) is None -def test_bytes_string(): - repo_path = b'./test/data/testrepo.git/' - pygit2.Repository(repo_path) - -def test_unicode_string(): - # String is unicode because of unicode_literals - repo_path = './test/data/testrepo.git/' - pygit2.Repository(repo_path) - -def test_aspath(): - repo_path = Path('./test/data/testrepo.git/') - pygit2.Repository(repo_path) - - -def test_clone_repository(tmp_path): - repo_path = "./test/data/testrepo.git/" - repo = clone_repository(repo_path, tmp_path) +def test_repository_init(barerepo_path): + barerepo, path = barerepo_path + assert isinstance(path, Path) + pygit2.Repository(path) + pygit2.Repository(str(path)) + pygit2.Repository(bytes(path)) + +def test_clone_repository(barerepo, tmp_path): + assert barerepo.is_bare + repo = clone_repository(Path(barerepo.path), tmp_path / 'clonepath') assert not repo.is_empty assert not repo.is_bare - -def test_clone_repository_aspath(tmp_path): - repo_path = Path("./test/data/testrepo.git/") - repo = clone_repository(repo_path, Path(tmp_path)) + repo = clone_repository(str(barerepo.path), str(tmp_path / 'clonestr')) assert not repo.is_empty assert not repo.is_bare -def test_clone_bare_repository(tmp_path): - repo_path = "./test/data/testrepo.git/" - repo = clone_repository(repo_path, tmp_path, bare=True) +def test_clone_bare_repository(barerepo, tmp_path): + repo = clone_repository(barerepo.path, tmp_path / 'clone', bare=True) assert not repo.is_empty assert repo.is_bare -def test_clone_repository_and_remote_callbacks(tmp_path): - src_repo_relpath = Path('./test/data/testrepo.git/').resolve() +def test_clone_repository_and_remote_callbacks(barerepo, tmp_path): + url = Path(barerepo.path).resolve().as_uri() repo_path = tmp_path / 'clone-into' - url = src_repo_relpath.as_uri() def create_repository(path, bare): return init_repository(path, bare) @@ -427,14 +415,11 @@ clone_repository(url, tmp_path, callbacks=MyCallbacks()) assert str(exc.value) == 'Unexpected error' -def test_clone_with_checkout_branch(tmp_path): +def test_clone_with_checkout_branch(barerepo, tmp_path): # create a test case which isolates the remote - test_repo = clone_repository('./test/data/testrepo.git', - tmp_path / 'testrepo-orig.git', - bare=True) + test_repo = clone_repository(barerepo.path, tmp_path / 'testrepo-orig.git', bare=True) test_repo.create_branch('test', test_repo[test_repo.head.target]) - repo = clone_repository(test_repo.path, - tmp_path / 'testrepo.git', + repo = clone_repository(test_repo.path, tmp_path / 'testrepo.git', checkout_branch='test', bare=True) assert repo.lookup_reference('HEAD').target == 'refs/heads/test' @@ -564,7 +549,7 @@ assert branch_name in testrepo.branches def test_open_extended(tmp_path): - with utils.TemporaryRepository('dirtyrepo.tar', tmp_path) as path: + with utils.TemporaryRepository('dirtyrepo.zip', tmp_path) as path: orig_repo = pygit2.Repository(path) assert not orig_repo.is_bare assert orig_repo.path diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/test/test_submodule.py new/pygit2-1.9.2/test/test_submodule.py --- old/pygit2-1.9.1/test/test_submodule.py 2022-03-20 08:43:53.770506000 +0100 +++ new/pygit2-1.9.2/test/test_submodule.py 2022-04-23 18:14:30.410124800 +0200 @@ -41,7 +41,7 @@ @pytest.fixture def repo(tmp_path): - with utils.TemporaryRepository('submodulerepo.tar', tmp_path) as path: + with utils.TemporaryRepository('submodulerepo.zip', tmp_path) as path: yield pygit2.Repository(path) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pygit2-1.9.1/test/utils.py new/pygit2-1.9.2/test/utils.py --- old/pygit2-1.9.1/test/utils.py 2022-03-20 08:27:15.959589500 +0100 +++ new/pygit2-1.9.2/test/utils.py 2022-04-23 18:14:30.410124800 +0200 @@ -31,6 +31,7 @@ import stat import sys import tarfile +import zipfile # Requirements import pytest @@ -108,10 +109,12 @@ def __enter__(self): path = Path(__file__).parent / 'data' / self.name temp_repo_path = Path(self.tmp_path) / path.stem - if path.suffix == '.tar': - tar = tarfile.open(path) - tar.extractall(self.tmp_path) - tar.close() + if path.suffix == '.zip': + with zipfile.ZipFile(path) as zipf: + zipf.extractall(self.tmp_path) + elif path.suffix == '.tar': + with tarfile.open(path) as tar: + tar.extractall(self.tmp_path) elif path.suffix == '.git': shutil.copytree(path, temp_repo_path) else: ++++++ support-libgit-1.5.patch ++++++ diff --git a/src/types.h b/src/types.h index 78023e28..e851eacb 100644 --- a/src/types.h +++ b/src/types.h @@ -32,8 +32,8 @@ #include <Python.h> #include <git2.h> -#if !(LIBGIT2_VER_MAJOR == 1 && LIBGIT2_VER_MINOR == 4) -#error You need a compatible libgit2 version (1.4.x) +#if !(LIBGIT2_VER_MAJOR == 1 && LIBGIT2_VER_MINOR >= 4 && LIBGIT2_VER_MINOR <= 5) +#error You need a compatible libgit2 version (1.4.x or 1.5.x) #endif /*