| |
@@ -3443,9 +3443,13 @@
|
| |
if ref_string in repo_obj.listall_references():
|
| |
reference = repo_obj.lookup_reference(ref_string)
|
| |
tag = repo_obj[reference.target]
|
| |
- if not isinstance(tag, pygit2.Tag):
|
| |
+ if isinstance(tag, pygit2.Tag):
|
| |
+ commit = tag.peel(pygit2.Commit)
|
| |
+ elif isinstance(tag, pygit2.Commit):
|
| |
+ commit = tag
|
| |
+ else:
|
| |
+ _log.debug("Found %s instead of a tag", tag)
|
| |
flask.abort(400, "Invalid reference provided")
|
| |
- commit = tag.peel(pygit2.Commit)
|
| |
else:
|
| |
try:
|
| |
commit = repo_obj.get(ref)
|
| |
We had a case where the reference given wasn't pointing to a tag
but to a commit. Which as a matter of fact, is fine since when
we are given a tag we want to go to the underlying commit.
So if we're given a commit, keep going.
Fixes https://pagure.io/pagure/issue/4278
Signed-off-by: Pierre-Yves Chibon pingou@pingoured.fr