Welcome to mirror list, hosted at ThFree Co, Russian Federation.

_diffs.html.haml « commits « views « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9a9aed39b0821b77cbb6254163b5a0e011877ab6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
- if @suppress_diff
  .alert-message.block-message
    %p
      %strong Warning! Large commit with more then #{Commit::DIFF_SAFE_SIZE} files changed.
    %p To prevent performance issue we rejected diff information.
    %p
      But if you still want to see diff
      = link_to "click this link", project_commit_path(@project, @commit, force_show_diff: true), class: "underlined_link"

%p.cgray
  Showing #{pluralize(diffs.count, "changed file")}
.file-stats
  = render "commits/diff_head", diffs: diffs

.files
  - unless @suppress_diff
    - diffs.each_with_index do |diff, i|
      - next if diff.diff.empty?
      - file = (@commit.tree / diff.new_path)
      - file = (@commit.prev_commit.tree / diff.old_path) unless file
      - next unless file
      .file{id: "diff-#{i}"}
        .header
          - if diff.deleted_file
            %span= diff.old_path

            - if @commit.prev_commit
              = link_to project_tree_path(@project, tree_join(@commit.prev_commit_id, diff.new_path)), {:class => 'btn right view-file'} do
                View file @
                %span.commit-short-id= @commit.short_id(6)
          - else
            %span= diff.new_path
            - if diff.a_mode && diff.b_mode && diff.a_mode != diff.b_mode
              %span.file-mode= "#{diff.a_mode} → #{diff.b_mode}"

            = link_to project_tree_path(@project, tree_join(@commit.id, diff.new_path)), {:class => 'btn very_small right view-file'} do
              View file @
              %span.commit-short-id= @commit.short_id(6)

        .content
          -# Skipp all non non-supported blobs
          - next unless file.respond_to?('text?')
          - if file.text?
            = render "commits/text_file", diff: diff, index: i
          - elsif file.image?
            - old_file = (@commit.prev_commit.tree / diff.old_path) if !@commit.prev_commit.nil?
            = render "commits/image", diff: diff, old_file: old_file, file: file, index: i
          - else
            %p.nothing_here_message No preview for this file type