From 8ffbe4b03d862bbcaa7bfddce7a3d13ee19f0341 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Sep 12 2017 13:03:43 +0000 Subject: Raise an exception if no commit hash was found Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/lib/git.py b/pagure/lib/git.py index 9337b06..6eda762 100644 --- a/pagure/lib/git.py +++ b/pagure/lib/git.py @@ -1361,6 +1361,11 @@ def get_diff_info(repo_obj, orig_repo, branch_from, branch_to, prid=None): except KeyError: pass + if not commitid: + raise pagure.exceptions.PagureException( + 'No branch from which to pull or local PR reference were found' + ) + diff_commits = [] diff = None orig_commit = None