diff --git a/pagure/ui/repo.py b/pagure/ui/repo.py index 845887b..f8aa621 100644 --- a/pagure/ui/repo.py +++ b/pagure/ui/repo.py @@ -414,6 +414,8 @@ def view_raw_file(repo, identifier, filename=None, username=None): try: commit = repo_obj.get(identifier) except ValueError: + if 'master' not in repo_obj.listall_branches(): + flask.abort(404, 'Branch no found') # If it's not a commit id then it's part of the filename commit = repo_obj[repo_obj.head.target]