From 3b7ed082295e605753bc8f80eabf5eb712ba82e7 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 4 Dec 2019 10:46:23 -0500 Subject: [PATCH] Fix exception in case where tree is browing a tag --- gitsrht/blueprints/repo.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gitsrht/blueprints/repo.py b/gitsrht/blueprints/repo.py index ea89bf3..9d739f1 100644 --- a/gitsrht/blueprints/repo.py +++ b/gitsrht/blueprints/repo.py @@ -143,6 +143,8 @@ def tree(owner, repo, ref, path): return render_empty_repo(owner, repo) commit, ref, path = lookup_ref(git_repo, ref, path) + if isinstance(commit, pygit2.Tag): + commit = git_repo.get(commit.target) tree = commit.tree if not tree: -- 2.38.4