summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-06-10 10:57:23 -0400
committerDrew DeVault <sir@cmpwn.com>2019-06-10 10:57:23 -0400
commit766903d9203c730b645a33c2edbed930a222249f (patch)
tree91080702f344c8942ad494969d0806a8530b4f91
parent32c50c52d0e7a5eb14cfc23a64a7a24926df7445 (diff)
More tag fixes
-rw-r--r--gitsrht/blueprints/repo.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/gitsrht/blueprints/repo.py b/gitsrht/blueprints/repo.py
index 1b528aa..fe9e068 100644
--- a/gitsrht/blueprints/repo.py
+++ b/gitsrht/blueprints/repo.py
@@ -261,7 +261,7 @@ def collect_refs(git_repo):
refs = {}
for _ref in git_repo.references:
_ref = _AnnotatedRef(git_repo, git_repo.references[_ref])
- if not _ref.type or not _ref.commit:
+ if not _ref.type or not hasattr(_ref, "commit"):
continue
if _ref.commit.id.hex not in refs:
refs[_ref.commit.id.hex] = []
@@ -369,6 +369,8 @@ def refs(owner, repo):
ref,
git_repo.get(git_repo.references[ref].target)
) for ref in git_repo.references if ref.startswith("refs/tags/")]
+ tags = [tag for tag in tags
+ if isinstance(tag[1], pygit2.Commit) or isinstance(tag[1], pygit2.Tag)]
def _tag_key(tag):
if isinstance(tag[1], pygit2.Commit):
return tag[1].commit_time