summaryrefslogtreecommitdiff
path: root/gbp/git.py
diff options
context:
space:
mode:
authorGuido Günther <g.guenther@tarent.de>2011-10-28 13:54:51 +0200
committerGuido Günther <agx@sigxcpu.org>2011-10-28 18:55:49 +0200
commit004eac7c7c6298b9f1c5e9cc1b6e6dea61433b57 (patch)
tree1af1a131a386f7049ce73c5167dbea3254280172 /gbp/git.py
parent27a921eefd474dd7fed0abed8c3667aa4e1bcaa2 (diff)
GitRepository: add head property to return the current HEAD
Diffstat (limited to 'gbp/git.py')
-rw-r--r--gbp/git.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/gbp/git.py b/gbp/git.py
index 43e5388..55039ed 100644
--- a/gbp/git.py
+++ b/gbp/git.py
@@ -215,6 +215,11 @@ class GitRepository(object):
"""The currently checked out branch"""
return self.get_branch()
+ @property
+ def head(self):
+ """return the SHA1 of the current HEAD"""
+ return self.rev_parse('HEAD')
+
#{ Branches and Merging
def create_branch(self, branch, rev=None):
"""