diff options
author | Marin Jankovski <maxlazio@gmail.com> | 2015-12-04 12:01:08 +0100 |
---|---|---|
committer | Marin Jankovski <maxlazio@gmail.com> | 2015-12-04 12:01:08 +0100 |
commit | b9a0f96d42f52dfdad57ac8a2a5056a9262e6a88 (patch) | |
tree | 391ded747f5fc9dbe22249760b02a20a0dd40f14 | |
parent | ea52a81da4888af232e9868d722cc91d5e442723 (diff) | |
download | gitlab-ce-b9a0f96d42f52dfdad57ac8a2a5056a9262e6a88.tar.gz |
Don't show diffs for lfs pointers.
-rw-r--r-- | app/models/lfs_object.rb | 2 | ||||
-rw-r--r-- | app/views/projects/diffs/_file.html.haml | 4 |
2 files changed, 2 insertions, 4 deletions
diff --git a/app/models/lfs_object.rb b/app/models/lfs_object.rb index f087d07b5b2..43b845b29c6 100644 --- a/app/models/lfs_object.rb +++ b/app/models/lfs_object.rb @@ -6,8 +6,6 @@ class LfsObject < ActiveRecord::Base mount_uploader :file, LfsObjectUploader - MATCH_FROM_POINTER_REGEX = "(?<=sha256:)([0-9a-f]{64})" - def storage_project(project) if project && project.forked? project.forked_from_project diff --git a/app/views/projects/diffs/_file.html.haml b/app/views/projects/diffs/_file.html.haml index b3392d00e01..ec1c665716e 100644 --- a/app/views/projects/diffs/_file.html.haml +++ b/app/views/projects/diffs/_file.html.haml @@ -25,7 +25,7 @@ = "#{diff_file.diff.a_mode} → #{diff_file.diff.b_mode}" .diff-controls - - if blob.text? + - if blob.text? && !blob.lfs_pointer? = link_to '#', class: 'js-toggle-diff-comments btn btn-sm active has_tooltip', title: "Toggle comments for this file" do %i.fa.fa-comments @@ -40,7 +40,7 @@ .diff-content.diff-wrap-lines -# Skipp all non non-supported blobs - return unless blob.respond_to?('text?') - - if blob.text? + - if blob.text? && !blob.lfs_pointer? - if diff_view == 'parallel' = render "projects/diffs/parallel_view", diff_file: diff_file, project: project, blob: blob, index: i - else |