From 7fb84024a5e3d7aceb2e228250f26759bd40d390 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 6 May 2020 11:22:56 -0400 Subject: [PATCH] Further generalize 404 cases on lookup_ref --- gitsrht/blueprints/repo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitsrht/blueprints/repo.py b/gitsrht/blueprints/repo.py index 3e56e0b..a306204 100644 --- a/gitsrht/blueprints/repo.py +++ b/gitsrht/blueprints/repo.py @@ -179,7 +179,7 @@ def lookup_ref(git_repo, ref, path): abort(404) if isinstance(commit, pygit2.Tag): commit = git_repo.get(commit.target) - if not commit: + if not commit or not isinstance(commit, pygit2.Commit): abort(404) return commit, ref, "/".join(path) -- 2.38.4