diff --git a/pagure/lib/git.py b/pagure/lib/git.py index 81ece74..8a47677 100644 --- a/pagure/lib/git.py +++ b/pagure/lib/git.py @@ -1282,6 +1282,11 @@ def diff_pull_request( if branch: commitid = branch.get_object().hex + if request.branch not in orig_repo.listall_branches(): + raise pagure.exceptions.PagureException( + 'The branch into which this pull-request was to be merged : %s ' + 'seems to no longer present in this repo' % request.branch) + if not repo_obj.is_empty and not orig_repo.is_empty: # Pull-request open master_commits = [