aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp
diff options
context:
space:
mode:
Diffstat (limited to 'gbp')
-rw-r--r--gbp/git/repository.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py
index 2fcc12cc..024a3775 100644
--- a/gbp/git/repository.py
+++ b/gbp/git/repository.py
@@ -618,6 +618,20 @@ class GitRepository(object):
if ret:
raise GitRepositoryError("Can't write out current index")
return tree[0].strip()
+
+ def get_obj_type(self, obj):
+ """
+ Get type of a git repository object
+
+ @param obj: repository object
+ @type obj: C{str}
+ @return: type of the repository object
+ @rtype: C{str}
+ """
+ out, ret = self.__git_getoutput('cat-file', args=['-t', obj])
+ if ret:
+ raise GitRepositoryError("Not a Git repository object: '%s'" % obj)
+ return out[0].strip()
#}
def get_config(self, name):