diff options
-rw-r--r-- | doc/source/changes.rst | 6 | ||||
-rw-r--r-- | git/refs/tag.py | 14 |
2 files changed, 13 insertions, 7 deletions
diff --git a/doc/source/changes.rst b/doc/source/changes.rst index bba538be..1feacab8 100644 --- a/doc/source/changes.rst +++ b/doc/source/changes.rst @@ -2,6 +2,12 @@ Changelog ========= +2.0.9 - Bugfixes +============================= + +* `tag.commit` will now resolve commits deeply. + +* `DiffIndex.iter_change_type(...)` produces better results when diffing 2.0.8 - Features and Bugfixes ============================= diff --git a/git/refs/tag.py b/git/refs/tag.py index 3334e53c..11dbab97 100644 --- a/git/refs/tag.py +++ b/git/refs/tag.py @@ -24,13 +24,13 @@ class TagReference(Reference): def commit(self): """:return: Commit object the tag ref points to""" obj = self.object - if obj.type == "commit": - return obj - elif obj.type == "tag": - # it is a tag object which carries the commit as an object - we can point to anything - return obj.object - else: - raise ValueError("Tag %s points to a Blob or Tree - have never seen that before" % self) + while obj.type != 'commit': + if obj.type == "tag": + # it is a tag object which carries the commit as an object - we can point to anything + obj = obj.object + else: + raise ValueError("Tag %s points to a Blob or Tree - have never seen that before" % self) + return obj @property def tag(self): |