2016-06-28 12:25:32 -04:00
|
|
|
.diff-content.diff-wrap-lines
|
2017-01-16 09:57:33 -05:00
|
|
|
-# Skip all non non-supported blobs
|
2016-06-28 12:25:32 -04:00
|
|
|
- return unless blob.respond_to?(:text?)
|
|
|
|
- if diff_file.too_large?
|
|
|
|
.nothing-here-block This diff could not be displayed because it is too large.
|
2017-04-13 12:57:43 -04:00
|
|
|
- elsif blob.too_large?
|
2017-04-13 13:19:50 -04:00
|
|
|
.nothing-here-block The file could not be displayed because it is too large.
|
2017-04-13 12:57:43 -04:00
|
|
|
- elsif blob.readable_text?
|
2016-06-28 12:25:32 -04:00
|
|
|
- if !project.repository.diffable?(blob)
|
|
|
|
.nothing-here-block This diff was suppressed by a .gitattributes entry.
|
2016-07-15 03:04:18 -04:00
|
|
|
- elsif diff_file.collapsed?
|
2016-11-10 12:24:12 -05:00
|
|
|
- url = url_for(params.merge(action: :diff_for_path, old_path: diff_file.old_path, new_path: diff_file.new_path, file_identifier: diff_file.file_identifier))
|
2016-12-26 05:47:16 -05:00
|
|
|
.nothing-here-block.diff-collapsed{ data: { diff_for_path: url } }
|
2016-09-02 10:26:45 -04:00
|
|
|
This diff is collapsed.
|
|
|
|
%a.click-to-expand
|
|
|
|
Click to expand it.
|
2016-06-28 12:25:32 -04:00
|
|
|
- elsif diff_file.diff_lines.length > 0
|
2017-01-25 15:22:29 -05:00
|
|
|
- total_lines = 0
|
|
|
|
- if blob.lines.any?
|
|
|
|
- total_lines = blob.lines.last.chomp == '' ? blob.lines.size - 1 : blob.lines.size
|
2016-07-21 14:44:12 -04:00
|
|
|
- if diff_view == :parallel
|
2017-01-24 18:53:25 -05:00
|
|
|
= render "projects/diffs/parallel_view", diff_file: diff_file, total_lines: total_lines
|
2016-06-28 12:25:32 -04:00
|
|
|
- else
|
2017-01-24 18:53:25 -05:00
|
|
|
= render "projects/diffs/text_file", diff_file: diff_file, total_lines: total_lines
|
2016-06-28 12:25:32 -04:00
|
|
|
- else
|
|
|
|
- if diff_file.mode_changed?
|
|
|
|
.nothing-here-block File mode changed
|
|
|
|
- elsif diff_file.renamed_file
|
|
|
|
.nothing-here-block File moved
|
|
|
|
- elsif blob.image?
|
2016-08-27 23:59:48 -04:00
|
|
|
- old_blob = diff_file.old_blob(diff_file.old_content_commit || @base_commit)
|
2016-06-28 12:25:32 -04:00
|
|
|
= render "projects/diffs/image", diff_file: diff_file, old_file: old_blob, file: blob
|
|
|
|
- else
|
|
|
|
.nothing-here-block No preview for this file type
|