Commit 59b11c3d authored by Marin Jankovski's avatar Marin Jankovski

Merge branch 'sh-fix-issue-41735' into 'master'

Fix error 500 when viewing commit and merge request diffs

Closes #41735

See merge request gitlab-org/gitlab-ce!16272
parents 54bacb18 c2b7147c
Pipeline #15877882 passed with stages
in 45 minutes and 26 seconds
......@@ -1187,7 +1187,7 @@ module Gitlab
end
# Items should be of format [[commit_id, path], [commit_id1, path1]]
def batch_blobs(items, blob_size_limit: nil)
def batch_blobs(items, blob_size_limit: Gitlab::Git::Blob::MAX_DATA_DISPLAY_SIZE)
Gitlab::Git::Blob.batch(self, items, blob_size_limit: blob_size_limit)
end
......
......@@ -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
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