diff options
author | Stan Hu <stanhu@gmail.com> | 2018-01-07 12:30:30 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-01-07 15:49:07 +0300 |
commit | c2b7147c2f4d600f066747d5a4388d2370c8a3e9 (patch) | |
tree | eb6193ea8b23b2af0552077ff3c3bd7fee8c3bd2 /spec/lib/gitlab/diff | |
parent | 54bacb1860036ffcd722f7df033d7def6b1a8756 (diff) |
Fix error 500 when viewing commit and merge request diffs
Due to the refactoring in !16082, `Blob#batch` no longer falls back
to a default `blob_size_limit`. Since `Repository#batch_blobs` was using
a default `nil` value, this would cause issues in the `Blob#find_by_rugged`
method.
This fix here is to be consistent and use a non-nil default value in
`Repository#batch_blobs`.
The problem was masked in development and tests because Gitaly is always
enabled by default for all features.
Closes #41735
Diffstat (limited to 'spec/lib/gitlab/diff')
-rw-r--r-- | spec/lib/gitlab/diff/file_collection/merge_request_diff_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/lib/gitlab/diff/file_collection/merge_request_diff_spec.rb b/spec/lib/gitlab/diff/file_collection/merge_request_diff_spec.rb index d81774c8b8f..a067c42b75b 100644 --- a/spec/lib/gitlab/diff/file_collection/merge_request_diff_spec.rb +++ b/spec/lib/gitlab/diff/file_collection/merge_request_diff_spec.rb @@ -19,4 +19,18 @@ describe Gitlab::Diff::FileCollection::MergeRequestDiff do diff_files end + + shared_examples 'initializes a DiffCollection' do + it 'returns a valid instance of a DiffCollection' do + expect(diff_files).to be_a(Gitlab::Git::DiffCollection) + end + end + + context 'with Gitaly disabled', :disable_gitaly do + it_behaves_like 'initializes a DiffCollection' + end + + context 'with Gitaly enabled' do + it_behaves_like 'initializes a DiffCollection' + end end |