Commit 0ee1313d authored by Igor Drozdov's avatar Igor Drozdov

Load 10mb of a diff instead of 100kb

When a small change for a large file introduced
we still need to display that diff file
parent 9785b85e
......@@ -353,11 +353,7 @@ module Gitlab
def fetch_blob(sha, path)
return unless sha
# Load only patch_hard_limit_bytes number of bytes for the blob
# Because otherwise, it is too large to be displayed
Blob.lazy(
repository.project, sha, path,
blob_size_limit: Gitlab::Git::Diff.patch_hard_limit_bytes)
Blob.lazy(repository.project, sha, path)
end
def total_blob_lines(blob)
......
......@@ -175,7 +175,7 @@ describe Gitlab::Diff::File do
[diff_file.new_content_sha, diff_file.new_path], [diff_file.old_content_sha, diff_file.old_path]
]
expect(project.repository).to receive(:blobs_at).with(items, blob_size_limit: 100 * 1024).and_call_original
expect(project.repository).to receive(:blobs_at).with(items, blob_size_limit: 10.megabytes).and_call_original
old_data = diff_file.old_blob.data
data = diff_file.new_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