From 46abcf94e22a23b0c9c3b665a67c83e4a54bd259 Mon Sep 17 00:00:00 2001 From: Michael Watters Date: Apr 19 2018 12:34:21 +0000 Subject: Bug - Fix exceptions caused by missing merge object Updated get_branches_of_commit function to avoid sending out pagure exceptions whenever a commit with missing merge objects is viewed. Fixes #3163. --- diff --git a/pagure/internal/__init__.py b/pagure/internal/__init__.py index f8de97e..0cc64c2 100644 --- a/pagure/internal/__init__.py +++ b/pagure/internal/__init__.py @@ -491,10 +491,13 @@ def get_branches_of_commit(): merge_commit = None if compare_branch: - merge_commit = repo_obj.merge_base( + merge_commit_obj = repo_obj.merge_base( compare_branch.get_object().hex, branch.get_object().hex - ).hex + ) + + if merge_commit_obj: + merge_commit = merge_commit_obj.hex repo_commit = repo_obj[branch.get_object().hex]