From 9ceaab204109e6486601d452e4f74a5c79318f09 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 6 May 2020 09:59:31 -0400 Subject: [PATCH] repo.tree: abort(404) on missing commit --- 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 3808b77..52fe049 100644 --- a/gitsrht/blueprints/repo.py +++ b/gitsrht/blueprints/repo.py @@ -200,7 +200,8 @@ def tree(owner, repo, ref, path): if isinstance(commit, pygit2.Tag): commit = git_repo.get(commit.target) orig_commit = commit - + if not commit: + abort(404) tree = commit.tree if not tree: abort(404) -- 2.38.4