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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2016-06-20 19:57:10 +0300
committerDouwe Maan <douwe@selenight.nl>2016-07-07 01:50:59 +0300
commit375193455aa5cb752f1035a6cc69160170a58477 (patch)
treee54ec42a455c02ab61ead34268841ef19ae339b4 /lib/gitlab/diff
parent4c1bf77c7fd3e62be4b9f6fd54520db0f7fc346b (diff)
Style diff and blob file headers the same way
Diffstat (limited to 'lib/gitlab/diff')
-rw-r--r--lib/gitlab/diff/file.rb15
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