From 9ce1193c851e98293a237ad3d2d87725c501e89f Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Thu, 15 Oct 2009 14:11:34 +0200 Subject: Added Commit.iter_parents to iterate all parents Renamed Commit.commits to iter_commits repo: assured proper use of the terms revision ( rev ) and reference ( ref ) --- lib/git/refs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/git/refs.py') diff --git a/lib/git/refs.py b/lib/git/refs.py index 3c9eb817..8ed578ef 100644 --- a/lib/git/refs.py +++ b/lib/git/refs.py @@ -10,7 +10,7 @@ from objects.base import Object from objects.utils import get_object_type_by_name from utils import LazyMixin, Iterable -class Ref(LazyMixin, Iterable): +class Reference(LazyMixin, Iterable): """ Represents a named reference to any object """ @@ -138,7 +138,7 @@ class Ref(LazyMixin, Iterable): # return cls(repo, full_path, obj) -class Head(Ref): +class Head(Reference): """ A Head is a named reference to a Commit. Every Head instance contains a name and a Commit object. @@ -181,7 +181,7 @@ class Head(Ref): -class TagRef(Ref): +class TagRef(Reference): """ Class representing a lightweight tag reference which either points to a commit or to a tag object. In the latter case additional information, like the signature -- cgit v1.2.1 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/refs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/git/refs.py') diff --git a/lib/git/refs.py b/lib/git/refs.py index 8ed578ef..a4d7bbb1 100644 --- a/lib/git/refs.py +++ b/lib/git/refs.py @@ -71,8 +71,8 @@ class Reference(LazyMixin, Iterable): always point to the actual object as it gets re-created on each query """ # have to be dynamic here as we may be a tag which can point to anything - hexsha, typename, size = self.repo.git.get_object_header(self.path) - return get_object_type_by_name(typename)(self.repo, hexsha) + # Our path will be resolved to the hexsha which will be used accordingly + return Object(self.repo, self.path) @classmethod def iter_items(cls, repo, common_path = "refs", **kwargs): -- cgit v1.2.1