Skip to content

Add limiting option to Blob.find and Blob.raw

What does this MR do?

Add a limit: argument to Gitlab::Git::Blob.find and Gitlab::Git::Blob.raw.

Also removes unused method Repository#blob_by_oid

Are there points in the code the reviewer needs to double check?

Why was this MR needed?

Because we could not indicate limits when loading a blob an awkward pattern has emerged over time. First load part of the blob, then reload the entire blob to be sure we dodged limiting. This change makes it so that callers can express their need for the entire blob the moment they load it.

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Edited by Jacob Vosmaer (GitLab)

Merge request reports