Commit 7b18c424 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Remove unused (?) code

parent 0d52e59d
...@@ -79,13 +79,6 @@ module Gitlab ...@@ -79,13 +79,6 @@ module Gitlab
@new_content_sha = refs&.head_sha @new_content_sha = refs&.head_sha
end 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 def old_content_sha
return if new_file? return if new_file?
return @old_content_sha if defined?(@old_content_sha) return @old_content_sha if defined?(@old_content_sha)
...@@ -94,13 +87,6 @@ module Gitlab ...@@ -94,13 +87,6 @@ module Gitlab
@old_content_sha = refs&.base_sha @old_content_sha = refs&.base_sha
end 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 def new_blob
return @new_blob if defined?(@new_blob) return @new_blob if defined?(@new_blob)
...@@ -123,10 +109,6 @@ module Gitlab ...@@ -123,10 +109,6 @@ module Gitlab
new_content_sha || old_content_sha new_content_sha || old_content_sha
end end
def content_commit
new_content_commit || old_content_commit
end
def blob def blob
new_blob || old_blob new_blob || old_blob
end end
......
...@@ -47,14 +47,6 @@ describe Gitlab::Diff::File do ...@@ -47,14 +47,6 @@ describe Gitlab::Diff::File do
end end
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 describe '#old_blob' do
it 'returns blob of commit of base commit' do it 'returns blob of commit of base commit' do
old_data = diff_file.old_blob.data old_data = diff_file.old_blob.data
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment