diff options
author | Douwe Maan <douwe@selenight.nl> | 2016-06-20 18:57:10 +0200 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-07-06 18:50:59 -0400 |
commit | 375193455aa5cb752f1035a6cc69160170a58477 (patch) | |
tree | e54ec42a455c02ab61ead34268841ef19ae339b4 /lib | |
parent | 4c1bf77c7fd3e62be4b9f6fd54520db0f7fc346b (diff) | |
download | gitlab-ce-375193455aa5cb752f1035a6cc69160170a58477.tar.gz |
Style diff and blob file headers the same way
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/diff/file.rb | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/gitlab/diff/file.rb b/lib/gitlab/diff/file.rb index 8a5c19609e4..eaa6fdff8aa 100644 --- a/lib/gitlab/diff/file.rb +++ b/lib/gitlab/diff/file.rb @@ -4,7 +4,8 @@ module Gitlab attr_reader :diff, :repository, :diff_refs delegate :new_file, :deleted_file, :renamed_file, - :old_path, :new_path, to: :diff, prefix: false + :old_path, :new_path, :a_mode, :b_mode, + :submodule?, :too_large?, to: :diff, prefix: false def initialize(diff, repository:, diff_refs: nil) @diff = diff @@ -40,11 +41,7 @@ module Gitlab end def mode_changed? - !!(diff.a_mode && diff.b_mode && diff.a_mode != diff.b_mode) - end - - def parser - Gitlab::Diff::Parser.new + a_mode && b_mode && a_mode != b_mode end def raw_diff @@ -56,13 +53,11 @@ module Gitlab end def prev_line(index) - if index > 0 - diff_lines[index - 1] - end + diff_lines[index - 1] if index > 0 end def file_path - new_path.presence || old_path.presence + new_path.presence || old_path end def added_lines |