Remove unused (?) code

This commit is contained in:
Jacob Vosmaer 2017-07-31 17:19:25 +02:00
parent 0d52e59de4
commit 7b18c42464
2 changed files with 0 additions and 26 deletions

View file

@ -79,13 +79,6 @@ module Gitlab
@new_content_sha = refs&.head_sha
end
def new_content_commit
return @new_content_commit if defined?(@new_content_commit)
sha = new_content_commit
@new_content_commit = repository.commit(sha) if sha
end
def old_content_sha
return if new_file?
return @old_content_sha if defined?(@old_content_sha)
@ -94,13 +87,6 @@ module Gitlab
@old_content_sha = refs&.base_sha
end
def old_content_commit
return @old_content_commit if defined?(@old_content_commit)
sha = old_content_sha
@old_content_commit = repository.commit(sha) if sha
end
def new_blob
return @new_blob if defined?(@new_blob)
@ -123,10 +109,6 @@ module Gitlab
new_content_sha || old_content_sha
end
def content_commit
new_content_commit || old_content_commit
end
def blob
new_blob || old_blob
end

View file

@ -47,14 +47,6 @@ describe Gitlab::Diff::File do
end
end
describe '#old_content_commit' do
it 'returns base commit' do
old_content_commit = diff_file.old_content_commit
expect(old_content_commit.id).to eq('6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9')
end
end
describe '#old_blob' do
it 'returns blob of commit of base commit' do
old_data = diff_file.old_blob.data