From fa62201a5ac265330373d52bf226e113d4dde36d Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 8 Jul 2021 09:53:25 -0400 Subject: [PATCH] Fix (another) issue with non-commit tags ~gregkh/linux-stable has a tag which points to a tree. --- gitsrht/blueprints/repo.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gitsrht/blueprints/repo.py b/gitsrht/blueprints/repo.py index 49e4f58..ee72f3e 100644 --- a/gitsrht/blueprints/repo.py +++ b/gitsrht/blueprints/repo.py @@ -107,7 +107,8 @@ def summary(owner, repo): for ref in git_repo.raw_listall_references() if ref.startswith(b"refs/tags/")] tags = [tag for tag in tags - if isinstance(tag[1], pygit2.Tag) or isinstance(tag[1], pygit2.Commit)] + if (isinstance(tag[1], pygit2.Tag) or isinstance(tag[1], pygit2.Commit)) + and isinstance(tag[1].get_object(), pygit2.Commit)] tags = sorted(tags, key=lambda c: commit_time(c[1]), reverse=True) latest_tag = tags[0] if len(tags) else None -- 2.38.4