summaryrefslogtreecommitdiff
path: root/lib/git/refs.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-10-15 18:07:04 +0200
committerSebastian Thiel <byronimo@gmail.com>2009-10-15 18:07:04 +0200
commitf2df1f56cccab13d5c92abbc6b18be725e7b4833 (patch)
tree3e3760e5b46095458cf75446330ba2fc25fa23e5 /lib/git/refs.py
parent58d692e2a1d7e3894dbed68efbcf7166d6ec3fb7 (diff)
parentb67bd4c730273a9b6cce49a8444fb54e654de540 (diff)
downloadgitpython-f2df1f56cccab13d5c92abbc6b18be725e7b4833.tar.gz
Merge branch 'repo_interface' into improvements
* repo_interface: Improved archive function by allowing it to directly write to an output stream - previously it would cache everything to memory and try to provide zipping functionality itself repo: made init and clone methods less specific, previously they wanted to do it 'barely' only. New method names closely follow the default git command names repo.commit_delta_base: removed 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 repo: removed commits_between but added a note about how this can be achieved using the iter_commits method; reorganized methods within the type as a start for more interface changes Added Commit.iter_parents to iterate all parents repo: removed a few methods because of redundancy or because it will be obsolete once the interface overhaul is finished. This commit is just intermediate
Diffstat (limited to 'lib/git/refs.py')
-rw-r--r--lib/git/refs.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/git/refs.py b/lib/git/refs.py
index 3c9eb817..a4d7bbb1 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
"""
@@ -71,8 +71,8 @@ class Ref(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):
@@ -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