Skip to content

Commit 79cd011

Browse files
imbuedhopejdavid
authored andcommitted
added a Tuple based value for the libgit2 version reference (#848)
1 parent a0215bc commit 79cd011

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

docs/general.rst

+8
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ library that has been built against. The version number has a
3939
>>> print(pygit2.LIBGIT2_VER_REVISION)
4040
0
4141

42+
.. py:data:: LIBGIT2_VER
43+
44+
Tuple value of the revision version numbers. For example, for the version
45+
``0.26.0``::
46+
47+
>>> print(pygit2.LIBGIT2_VER_REVISION)
48+
(0, 26, 0)
49+
4250
.. py:data:: LIBGIT2_VERSION
4351
4452
The libgit2 version number as a string::

pygit2/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@
7676
GIT_FETCH_PRUNE = C.GIT_FETCH_PRUNE
7777
GIT_FETCH_NO_PRUNE = C.GIT_FETCH_NO_PRUNE
7878

79+
# libgit version tuple
80+
LIBGIT2_VER = (LIBGIT2_VER_MAJOR, LIBGIT2_VER_MINOR, LIBGIT2_VER_REVISION)
7981

8082
def init_repository(path, bare=False,
8183
flags=GIT_REPOSITORY_INIT_MKPATH,

0 commit comments

Comments
 (0)