Commit 16b8a1ef authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce

parents 690aafeb 2d85458a
...@@ -8,7 +8,7 @@ class Repository ...@@ -8,7 +8,7 @@ class Repository
@project = project @project = project
if path_with_namespace if path_with_namespace
@raw_repository = Gitlab::Git::Repository.new(path_to_repo) @raw_repository = Gitlab::Git::Repository.new(path_to_repo)
@raw_repository.autocrlf = :input @raw_repository.autocrlf = :input
end end
...@@ -173,7 +173,9 @@ class Repository ...@@ -173,7 +173,9 @@ class Repository
end end
def blob_at(sha, path) def blob_at(sha, path)
Gitlab::Git::Blob.find(self, sha, path) unless Gitlab::Git.blank_ref?(sha)
Gitlab::Git::Blob.find(self, sha, path)
end
end end
def blob_by_oid(oid) def blob_by_oid(oid)
......
...@@ -25,4 +25,12 @@ describe Repository do ...@@ -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
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