From fd1aab22021a722374d9c6fd587151c5b6eaeb2e Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Nov 09 2015 08:51:49 +0000 Subject: Move get_pygit2_version into pagure.lib.repo --- diff --git a/pagure/lib/git.py b/pagure/lib/git.py index 50c89b1..1569659 100644 --- a/pagure/lib/git.py +++ b/pagure/lib/git.py @@ -32,13 +32,6 @@ from pagure.lib.repo import PagureRepo # pylint: disable=R0913,E1101,R0914 -def get_pygit2_version(): - ''' Return pygit2 version as a tuple of integers. - This is needed for correct version comparison. - ''' - return tuple([int(i) for i in pygit2.__version__.split('.')]) - - def commit_to_patch(repo_obj, commits): ''' For a given commit (PyGit2 commit object) of a specified git repo, returns a string representation of the changes the commit did in a diff --git a/pagure/lib/repo.py b/pagure/lib/repo.py index 2db6ba5..5a5cf0b 100644 --- a/pagure/lib/repo.py +++ b/pagure/lib/repo.py @@ -13,7 +13,13 @@ import pygit2 import pagure import pagure.exceptions -import pagure.lib.git + + +def get_pygit2_version(): + ''' Return pygit2 version as a tuple of integers. + This is needed for correct version comparison. + ''' + return tuple([int(i) for i in pygit2.__version__.split('.')]) class PagureRepo(pygit2.Repository):