diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-05-15 12:10:51 -0500 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-05-23 15:37:04 -0500 |
commit | db40c668de96e6dfcdb07792b881118867c2ff52 (patch) | |
tree | 6bbac9c0c7165205d830d1e19be8b2f19264a256 | |
parent | d9a0188d2f7dfc07b426d36eeebc2c94385c12ca (diff) | |
download | gitlab-ce-db40c668de96e6dfcdb07792b881118867c2ff52.tar.gz |
Rename Diff::File {old,new}_ref to {old,new}_sha
-rw-r--r-- | lib/gitlab/diff/file.rb | 8 | ||||
-rw-r--r-- | lib/gitlab/diff/highlight.rb | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/gitlab/diff/file.rb b/lib/gitlab/diff/file.rb index cb9fda36156..a812d549397 100644 --- a/lib/gitlab/diff/file.rb +++ b/lib/gitlab/diff/file.rb @@ -52,20 +52,20 @@ module Gitlab def content_commit return unless diff_refs - repository.commit(deleted_file ? old_ref : new_ref) + repository.commit(deleted_file? ? old_sha : new_sha) end def old_content_commit return unless diff_refs - repository.commit(old_ref) + repository.commit(old_sha) end - def old_ref + def old_sha diff_refs.try(:base_sha) end - def new_ref + def new_sha diff_refs.try(:head_sha) end diff --git a/lib/gitlab/diff/highlight.rb b/lib/gitlab/diff/highlight.rb index 7db896522a9..ed2f541977a 100644 --- a/lib/gitlab/diff/highlight.rb +++ b/lib/gitlab/diff/highlight.rb @@ -3,7 +3,7 @@ module Gitlab class Highlight attr_reader :diff_file, :diff_lines, :raw_lines, :repository - delegate :old_path, :new_path, :old_ref, :new_ref, to: :diff_file, prefix: :diff + delegate :old_path, :new_path, :old_sha, :new_sha, to: :diff_file, prefix: :diff def initialize(diff_lines, repository: nil) @repository = repository @@ -61,12 +61,12 @@ module Gitlab def old_lines return unless diff_file - @old_lines ||= Gitlab::Highlight.highlight_lines(self.repository, diff_old_ref, diff_old_path) + @old_lines ||= Gitlab::Highlight.highlight_lines(self.repository, diff_old_sha, diff_old_path) end def new_lines return unless diff_file - @new_lines ||= Gitlab::Highlight.highlight_lines(self.repository, diff_new_ref, diff_new_path) + @new_lines ||= Gitlab::Highlight.highlight_lines(self.repository, diff_new_sha, diff_new_path) end end end |