summaryrefslogtreecommitdiff
path: root/gbp/git.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2011-11-07 17:54:36 +0100
committerGuido Günther <agx@sigxcpu.org>2011-11-07 18:05:41 +0100
commit7870360f216773451a84bd66e8c6f01fe7d8a9e1 (patch)
treefa7224ed1835c56577a42222412dff31e1ba1ac7 /gbp/git.py
parent8038a46e77b557ed234a0cfcb3c6109190d1b2c2 (diff)
GitRepository: add checkout() to checkout a treeish
Diffstat (limited to 'gbp/git.py')
-rw-r--r--gbp/git.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/gbp/git.py b/gbp/git.py
index 66aec40..dbf918a 100644
--- a/gbp/git.py
+++ b/gbp/git.py
@@ -633,6 +633,15 @@ class GitRepository(object):
return sha[0].strip()
#{ Trees
+ def checkout(self, treeish):
+ """
+ Checkout treeish
+
+ @param treeish: the treeish to check out
+ @type treeish: C{str}
+ """
+ self._git_command("checkout", ["--quiet", treeish])
+
def has_treeish(self, treeish):
"""
Check if the repository has the treeish object I{treeish}.