diff options
author | Guido Günther <agx@sigxcpu.org> | 2012-01-10 15:00:15 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2012-01-10 16:09:49 +0100 |
commit | 07b86440438286a03ffa7b314534f9bbb3d0a805 (patch) | |
tree | 91e036cf600887e13e75b7208a7542f2cac592e1 /gbp | |
parent | 205854df1f005bf8c8732f6b32492ede3a130c28 (diff) |
GitRepository: add verify_tag()
Diffstat (limited to 'gbp')
-rw-r--r-- | gbp/git/repository.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py index e8692c0..92cd40d 100644 --- a/gbp/git/repository.py +++ b/gbp/git/repository.py @@ -21,7 +21,7 @@ import subprocess import os.path import gbp.log as log -from gbp.command_wrappers import (GitCommand, copy_from) +from gbp.command_wrappers import (GitCommand, CommandExecFailed, copy_from) from gbp.errors import GbpError from gbp.git.modifier import GitModifier from gbp.git.commit import GitCommit @@ -455,6 +455,24 @@ class GitRepository(object): """ args = [ '-l', pattern ] if pattern else [] return [ line.strip() for line in self.__git_getoutput('tag', args)[0] ] + + def verify_tag(self, tag): + """ + Verify a signed tag + + @param tag: the tag's name + @type tag: C{str} + @return: Whether the signature on the tag could be verified + @rtype: C{bool} + """ + args = GitArgs('-v', tag) + + try: + self._git_command('tag', args.args) + except CommandExecFailed: + return False + return True + #} def force_head(self, commit, hard=False): """ |