diff options
author | Guido Günther <agx@sigxcpu.org> | 2011-11-15 19:59:13 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2011-11-20 14:24:24 +0100 |
commit | e87e62fc4969cb7d21e5fb07f7da505f48355e05 (patch) | |
tree | 9d763e9e33af5963631a9468b2de3193ced2b3a5 /gbp/git/__init__.py | |
parent | e7bbada49300f987ae129147fffe244d0d7a4cb6 (diff) |
Move GitCommit class into separate file
Diffstat (limited to 'gbp/git/__init__.py')
-rw-r--r-- | gbp/git/__init__.py | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/gbp/git/__init__.py b/gbp/git/__init__.py index 2aef0d5..7c48444 100644 --- a/gbp/git/__init__.py +++ b/gbp/git/__init__.py @@ -26,37 +26,13 @@ import dateutil.parser import calendar from gbp.git.modifier import GitModifier +from gbp.git.commit import GitCommit from gbp.git.errors import GitError class GitRepositoryError(GitError): """Exception thrown by L{GitRepository}""" pass -class GitCommit(object): - """A git commit""" - sha1_re = re.compile(r'[0-9a-f]{40}$') - - @staticmethod - def is_sha1(value): - """ - Is I{value} a valid 40 digit SHA1? - - >>> GitCommit.is_sha1('asdf') - False - >>> GitCommit.is_sha1('deadbeef') - False - >>> GitCommit.is_sha1('17975594b2d42f2a3d144a9678fdf2c2c1dd96a0') - True - >>> GitCommit.is_sha1('17975594b2d42f2a3d144a9678fdf2c2c1dd96a0toolong') - False - - @param value: the value to check - @type value: C{str} - @return: C{True} if I{value} is a 40 digit SHA1, C{False} otherwise. - @rtype: C{bool} - """ - return True if GitCommit.sha1_re.match(value) else False - class GitRepository(object): """ |