Skip to content
Snippets Groups Projects
Unverified Commit baf12f45 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Repository#blob_at should return nil for 00000000... sha

parent e934a62a
No related branches found
No related tags found
1 merge request!916Repository#blob_at should return nil for 00000000... sha
Pipeline #
Loading
@@ -173,8 +173,10 @@ class Repository
Loading
@@ -173,8 +173,10 @@ class Repository
end end
   
def blob_at(sha, path) def blob_at(sha, path)
unless Gitlab::Git.blank_ref?(sha)
Gitlab::Git::Blob.find(self, sha, path) Gitlab::Git::Blob.find(self, sha, path)
end end
end
   
def blob_by_oid(oid) def blob_by_oid(oid)
Gitlab::Git::Blob.raw(self, oid) Gitlab::Git::Blob.raw(self, oid)
Loading
Loading
Loading
@@ -25,4 +25,12 @@ describe Repository do
Loading
@@ -25,4 +25,12 @@ describe Repository do
   
it { is_expected.to eq('c1acaa58bbcbc3eafe538cb8274ba387047b69f8') } it { is_expected.to eq('c1acaa58bbcbc3eafe538cb8274ba387047b69f8') }
end end
describe :blob_at do
context 'blank sha' do
subject { repository.blob_at(Gitlab::Git::BLANK_SHA, '.gitignore') }
it { is_expected.to be_nil }
end
end
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment