Commit 8000fb44b7d0eb2312011cf6e21a2cc406dd103b
Exists in
spb-stable
and in
2 other branches
Merge branch 'file-mode-changed' into 'master'
Show file mode changes on commit page ## Before:  ## After: 
Showing
5 changed files
with
16 additions
and
7 deletions
Show diff stats
Gemfile.lock
@@ -164,7 +164,7 @@ GEM | @@ -164,7 +164,7 @@ GEM | ||
164 | multi_json | 164 | multi_json |
165 | gitlab-grack (2.0.0.pre) | 165 | gitlab-grack (2.0.0.pre) |
166 | rack (~> 1.5.1) | 166 | rack (~> 1.5.1) |
167 | - gitlab-grit (2.6.8) | 167 | + gitlab-grit (2.6.9) |
168 | charlock_holmes (~> 0.6) | 168 | charlock_holmes (~> 0.6) |
169 | diff-lcs (~> 1.1) | 169 | diff-lcs (~> 1.1) |
170 | mime-types (~> 1.15) | 170 | mime-types (~> 1.15) |
app/assets/stylesheets/sections/diff.scss
@@ -11,7 +11,6 @@ | @@ -11,7 +11,6 @@ | ||
11 | 11 | ||
12 | > span { | 12 | > span { |
13 | font-family: $monospace_font; | 13 | font-family: $monospace_font; |
14 | - font-size: 14px; | ||
15 | line-height: 2; | 14 | line-height: 2; |
16 | } | 15 | } |
17 | 16 | ||
@@ -19,9 +18,7 @@ | @@ -19,9 +18,7 @@ | ||
19 | float: right; | 18 | float: right; |
20 | 19 | ||
21 | .btn { | 20 | .btn { |
22 | - background-color: #EEE; | ||
23 | - color: #666; | ||
24 | - font-weight: bolder; | 21 | + background-color: #FFF; |
25 | } | 22 | } |
26 | } | 23 | } |
27 | 24 | ||
@@ -32,6 +29,7 @@ | @@ -32,6 +29,7 @@ | ||
32 | 29 | ||
33 | .file-mode { | 30 | .file-mode { |
34 | font-family: $monospace_font; | 31 | font-family: $monospace_font; |
32 | + margin-left: 10px; | ||
35 | } | 33 | } |
36 | } | 34 | } |
37 | .diff-content { | 35 | .diff-content { |
@@ -51,6 +49,11 @@ | @@ -51,6 +49,11 @@ | ||
51 | } | 49 | } |
52 | } | 50 | } |
53 | 51 | ||
52 | + .file-mode-changed { | ||
53 | + padding: 10px; | ||
54 | + color: #777; | ||
55 | + } | ||
56 | + | ||
54 | table { | 57 | table { |
55 | width: 100%; | 58 | width: 100%; |
56 | font-family: $monospace_font; | 59 | font-family: $monospace_font; |
app/helpers/commits_helper.rb
@@ -216,4 +216,8 @@ module CommitsHelper | @@ -216,4 +216,8 @@ module CommitsHelper | ||
216 | link_to(text.html_safe, user_path(user), options) | 216 | link_to(text.html_safe, user_path(user), options) |
217 | end | 217 | end |
218 | end | 218 | end |
219 | + | ||
220 | + def diff_file_mode_changed?(diff) | ||
221 | + diff.a_mode && diff.b_mode && diff.a_mode != diff.b_mode | ||
222 | + end | ||
219 | end | 223 | end |
app/views/projects/commits/_diffs.html.haml
@@ -42,7 +42,6 @@ | @@ -42,7 +42,6 @@ | ||
42 | .files | 42 | .files |
43 | - unless @suppress_diff | 43 | - unless @suppress_diff |
44 | - diffs.each_with_index do |diff, i| | 44 | - diffs.each_with_index do |diff, i| |
45 | - - next if diff.diff.empty? | ||
46 | - file = project.repository.blob_at(@commit.id, diff.new_path) | 45 | - file = project.repository.blob_at(@commit.id, diff.new_path) |
47 | - file = project.repository.blob_at(@commit.parent_id, diff.old_path) unless file | 46 | - file = project.repository.blob_at(@commit.parent_id, diff.old_path) unless file |
48 | - next unless file | 47 | - next unless file |
@@ -58,7 +57,7 @@ | @@ -58,7 +57,7 @@ | ||
58 | %span.commit-short-id= @commit.short_id(6) | 57 | %span.commit-short-id= @commit.short_id(6) |
59 | - else | 58 | - else |
60 | %span= diff.new_path | 59 | %span= diff.new_path |
61 | - - if diff.a_mode && diff.b_mode && diff.a_mode != diff.b_mode | 60 | + - if diff_file_mode_changed?(diff) |
62 | %span.file-mode= "#{diff.a_mode} → #{diff.b_mode}" | 61 | %span.file-mode= "#{diff.a_mode} → #{diff.b_mode}" |
63 | 62 | ||
64 | .diff-btn-group | 63 | .diff-btn-group |
app/views/projects/commits/_text_file.html.haml
@@ -22,3 +22,6 @@ | @@ -22,3 +22,6 @@ | ||
22 | - unless comments.empty? | 22 | - unless comments.empty? |
23 | = render "projects/notes/diff_notes_with_reply", notes: comments, line: line | 23 | = render "projects/notes/diff_notes_with_reply", notes: comments, line: line |
24 | 24 | ||
25 | +- if diff.diff.blank? && diff_file_mode_changed?(diff) | ||
26 | + .file-mode-changed | ||
27 | + File mode changed |