From 74104e6b4eb4167b0a3a9c1a547b0150521f2c14 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Oct 19 2016 11:12:12 +0000 Subject: Do not always compute the list of diff commits If the repo has a branch but no main branch (defaults to master), then we end up going through all the commits of the branch and say that they aren't in the main branch, which make sense since there are no main branch. But this leads to an error when trying to build the URL to open the pull-request between that main branch and the current one. So if there are no main branch, don't compute the list of different commits and don't show the notification about potential PR, just show the list of commits as if it was all good. Fixes https://pagure.io/pagure/issue/1441 --- diff --git a/pagure/templates/commits.html b/pagure/templates/commits.html index afab59a..131c552 100644 --- a/pagure/templates/commits.html +++ b/pagure/templates/commits.html @@ -57,7 +57,7 @@ - {% if diff_commits|count > 0 %} + {% if diff_commits|count > 0 and head %}