From 0996049122842a343e0ea7fbbecafddb2b4ba9d3 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sun, 29 May 2011 21:59:12 +0200 Subject: Intermediate commit with quite some progress in order to put all extra methods on the default Repo implementation into interfaces or something that can be abstracted. It shows that it would indeed be good to keep the differentiation between Repositories which contain an object database as it is clearly easier to setup any combination of repositories that use git and those that do not, with just the addition of one more level of indirection. Lets see how it will end up --- git/db/compat.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'git/db/compat.py') diff --git a/git/db/compat.py b/git/db/compat.py index 1c0ba6f5..16bf0562 100644 --- a/git/db/compat.py +++ b/git/db/compat.py @@ -11,3 +11,20 @@ class RepoCompatInterface(object): @property def bare(self): return self.is_bare + + def rev_parse(self, *args, **kwargs): + return self.resolve_object(*args, **kwargs) + + @property + def odb(self): + """The odb is now an integrated part of each repository""" + return self + + @property + def active_branch(self): + """The name of the currently active branch. + + :return: Head to the active branch""" + return self.head.reference + + -- cgit v1.2.3