diff --git a/pagure/ui/repo.py b/pagure/ui/repo.py index 73ddfae..1ea7dd2 100644 --- a/pagure/ui/repo.py +++ b/pagure/ui/repo.py @@ -960,8 +960,13 @@ def view_tree(repo, identifier=None, username=None, namespace=None): except (ValueError, TypeError): # If it's not a commit id then it's part of the filename if not repo_obj.head_is_unborn: - commit = repo_obj[repo_obj.head.target] branchname = repo_obj.head.shorthand + commit = repo_obj[repo_obj.head.target] + flask.flash( + "'%s' not found in the git repository, going back to: " + "%s" % (identifier, branchname), + "error", + ) # If we're arriving here from the release page, we may have a Tag # where we expected a commit, in this case, get the actual commit if isinstance(commit, pygit2.Tag):