Step 3: Version Control for Snippets: Implement access rights checking max snippet size (MVP)
This is a follow-up issue for https://gitlab.com/gitlab-org/gitlab/-/issues/205628.
We need to ensure as well that the content of the file longer than Gitlab::CurrentSettings.snippet_size_limit
. There is an example of how the push changes can be retrieved in https://gitlab.com/gitlab-org/gitlab/blob/master/ee/lib/ee/gitlab/git_access.rb#L112.
Since checking individual file size can introduce N+1 query, we will instead check the total size by using git count-objects
.
Edited by Mark Chao