aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp
diff options
context:
space:
mode:
authorGuido Guenther <agx@sigxcpu.org>2008-09-22 19:54:00 +0200
committerGuido Guenther <agx@sigxcpu.org>2008-09-22 20:07:08 +0200
commit519901ec9dccb0c47e1f067a8cc6dd2ab3e8f5b9 (patch)
tree0d4aa2908e3ee08983bbcb4c7405cdb628ceedaf /gbp
parent631c3479cc8ee98374ecd07de038aeac01c09695 (diff)
add find_tag(branch)
Diffstat (limited to 'gbp')
-rw-r--r--gbp/git_utils.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/gbp/git_utils.py b/gbp/git_utils.py
index 670d9903..9885fc9c 100644
--- a/gbp/git_utils.py
+++ b/gbp/git_utils.py
@@ -111,6 +111,13 @@ class GitRepository(object):
for line in commit:
yield line
+ def find_tag(self, branch):
+ "find the closest tag to a branch's head"
+ tag, ret = self.__git_getoutput('describe', [ "--abbrev=0", branch ])
+ if ret:
+ raise GitRepositoryError, "can't find tag for %s" % branch
+ return tag[0].strip()
+
def write_tree(self):
"""write out the current index, return the SHA1"""
tree, ret = self.__git_getoutput('write-tree')