summaryrefslogtreecommitdiff
path: root/lib/git/repo.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-10-15 15:42:00 +0200
committerSebastian Thiel <byronimo@gmail.com>2009-10-15 15:42:00 +0200
commit39229db70e71a6be275dafb3dd9468930e40ae48 (patch)
treec631f2b69c7f5874834214cf32970c48f05b5613 /lib/git/repo.py
parent9f51eeb2f9a1efe22e45f7a1f7b963100f2f8e6b (diff)
downloadgitpython-39229db70e71a6be275dafb3dd9468930e40ae48.tar.gz
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
Diffstat (limited to 'lib/git/repo.py')
-rw-r--r--lib/git/repo.py6
1 files changed, 2 insertions, 4 deletions
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):