Skip to content

Commit

Permalink
BOO
Browse files Browse the repository at this point in the history
  • Loading branch information
nphilipp committed Jan 7, 2025
1 parent 2f37b63 commit 844270e
Show file tree
Hide file tree
Showing 9 changed files with 1,456 additions and 1 deletion.
13 changes: 13 additions & 0 deletions rpmautospec/minigit2/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""Minimal wrapper for libgit2
This package wraps the functionality of libgit2 used by rpmautospec (and
only that), aiming to mimic the pygit2 API (of the minimum version
supported, 1.1).
The reason why we don’t use pygit2 itself is because it makes
bootstrapping rpmautospec hairy (e.g. for a new Python version).
"""

from .constants import GIT_REPOSITORY_OPEN_NO_SEARCH
from .exc import GitError
from .wrapper import Commit, Repository, Tree
8 changes: 8 additions & 0 deletions rpmautospec/minigit2/constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from . import native_adaptation

GIT_DIFF_OPTIONS_VERSION = 1

GIT_OID_RAWSZ = GIT_OID_SHA1_SIZE = 20
GIT_OID_HEXSZ = GIT_OID_SHA1_HEXSIZE = GIT_OID_SHA1_SIZE * 2

GIT_REPOSITORY_OPEN_NO_SEARCH = native_adaptation.git_repository_open_flag_t.NO_SEARCH
25 changes: 25 additions & 0 deletions rpmautospec/minigit2/exc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""Minimal wrapper for libgit2 - Exceptions and Warnings"""


class Libgit2Error(Exception):
pass


class Libgit2NotFoundError(Libgit2Error):
pass


class Libgit2VersionError(Libgit2Error):
pass


class Libgit2VersionWarning(UserWarning):
pass


class GitError(Exception):
pass


class GitPeelError(GitError):
pass
Loading

0 comments on commit 844270e

Please sign in to comment.