#1022 Fix diffs not showing for additions under 1000 lines
Merged 7 years ago by pingou. Opened 7 years ago by ryanlerch.
ryanlerch/pagure diffs_not_showing  into  master

@@ -420,16 +420,13 @@ 

            <div class="text-muted text-xs-center">empty file added</div>

          </div>

        {% 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 %}

            <div class="card-block">

              <div class="text-muted text-xs-center">

                  The added file is too large to be shown here, see it at:

                  {{ viewfilelink(patch_new_file_path) }}

              </div>

            </div>

-           {% endif %}

          {% elif patchtype == "removed" %}

            <div class="card-block">

              <div class="text-muted text-xs-center">

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.

:thumbsup: for me, thanks!

rebased

7 years ago

Pull-Request has been merged by pingou

7 years ago
Metadata