Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added a Tuple based value for the libgit2 version reference #848

Merged
merged 1 commit into from
Dec 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/general.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ library that has been built against. The version number has a
>>> print(pygit2.LIBGIT2_VER_REVISION)
0

.. py:data:: LIBGIT2_VER

Tuple value of the revision version numbers. For example, for the version
``0.26.0``::

>>> print(pygit2.LIBGIT2_VER_REVISION)
(0, 26, 0)

.. py:data:: LIBGIT2_VERSION

The libgit2 version number as a string::
Expand Down
2 changes: 2 additions & 0 deletions pygit2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@
GIT_FETCH_PRUNE = C.GIT_FETCH_PRUNE
GIT_FETCH_NO_PRUNE = C.GIT_FETCH_NO_PRUNE

# libgit version tuple
LIBGIT2_VER = (LIBGIT2_VER_MAJOR, LIBGIT2_VER_MINOR, LIBGIT2_VER_REVISION)

def init_repository(path, bare=False,
flags=GIT_REPOSITORY_INIT_MKPATH,
Expand Down