aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp/git/repository.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2012-01-10 15:00:15 +0100
committerGuido Günther <agx@sigxcpu.org>2012-01-10 16:09:49 +0100
commit07b86440438286a03ffa7b314534f9bbb3d0a805 (patch)
tree91e036cf600887e13e75b7208a7542f2cac592e1 /gbp/git/repository.py
parent205854df1f005bf8c8732f6b32492ede3a130c28 (diff)
GitRepository: add verify_tag()
Diffstat (limited to 'gbp/git/repository.py')
-rw-r--r--gbp/git/repository.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py
index e8692c0d..92cd40d4 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):
"""