From a43d7f129c27f0f86121e80bff2c660f7a29fce9 Mon Sep 17 00:00:00 2001 From: Sriram Raghu Date: Tue, 18 Dec 2018 12:15:46 -0500 Subject: [PATCH] added a Tuple based value for the libgit2 version reference --- docs/general.rst | 8 ++++++++ pygit2/__init__.py | 2 ++ 2 files changed, 10 insertions(+) diff --git a/docs/general.rst b/docs/general.rst index d50ac9630..60a8ecd08 100644 --- a/docs/general.rst +++ b/docs/general.rst @@ -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:: diff --git a/pygit2/__init__.py b/pygit2/__init__.py index 0d8067c60..75225163b 100644 --- a/pygit2/__init__.py +++ b/pygit2/__init__.py @@ -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,