From 9ae9fd67c1e919718777ba0dc28f41d5fe53e89d Mon Sep 17 00:00:00 2001 From: Ryan Lerch Date: Jun 01 2016 07:57:19 +0000 Subject: Fix diffs not showing for additions under 1000 lines Commit https://pagure.io/pagure/c/b771bf3f4fa73e1f1544114bf799e3a2361feafa Fixed the issues for the multiple versions of pygit2 that we support, however it also introduced a bug where additions with < 1000 lines would not show anything (either a diff or a message saying too large). Turns out we previously set a jinja variable that stored the linesadded amount (with support for multiple versions of libgit2), so this commit just uses that variable. --- diff --git a/pagure/templates/pull_request.html b/pagure/templates/pull_request.html index 2aafb91..ee90cb9 100644 --- a/pagure/templates/pull_request.html +++ b/pagure/templates/pull_request.html @@ -420,16 +420,13 @@
empty file added
{% else %} - {% if patchtype == "added" %} - {% if (patch| hasattr('line_stats') and patch.line_stats[1] > 1000) - or (patch| hasattr('additions') and patch.additions > 1000) %} + {% if patchtype == "added" and linesadded > 1000 %}
The added file is too large to be shown here, see it at: {{ viewfilelink(patch_new_file_path) }}
- {% endif %} {% elif patchtype == "removed" %}