From 39229db70e71a6be275dafb3dd9468930e40ae48 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Thu, 15 Oct 2009 15:42:00 +0200 Subject: Object can now create objects of the proper type in case one attempts to create an object directly - this feature is used in several places now, allowing for additional type-checking --- lib/git/repo.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/git/repo.py') diff --git a/lib/git/repo.py b/lib/git/repo.py index 9ac6ce0c..1d24edb7 100644 --- a/lib/git/repo.py +++ b/lib/git/repo.py @@ -129,10 +129,8 @@ class Repo(object): if rev is None: rev = self.active_branch - # NOTE: currently we are not checking wheter rev really points to a commit - # If not, the system will barf on access of the object, but we don't do that - # here to safe cycles - c = Commit(self, rev) + c = Object(self, rev) + assert c.type == "commit", "Revision %s did not point to a commit, but to %s" % (rev, c) return c def tree(self, ref=None): -- cgit v1.2.1