Skip to content

git expects boolean value to be lower case #578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 16 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(tag): improve tag resolution handling
The handling is similar, but the error message makes clear
what is happening, and what can be done to handle such a case.

Related to #561
  • Loading branch information
Byron authored and barry-scott committed Feb 2, 2017
commit 2d4844d157d79c4404dfe1a6fd61930dd6314916
7 changes: 5 additions & 2 deletions git/refs/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,17 @@ class TagReference(Reference):

@property
def commit(self):
""":return: Commit object the tag ref points to"""
""":return: Commit object the tag ref points to

:raise ValueError: if the tag points to a tree or blob"""
obj = self.object
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)
raise ValueError(("Cannot resolve commit as tag %s points to a %s object - "
+ "use the `.object` property instead to access it") % (self, obj.type))
return obj

@property
Expand Down