Commit 725d921d authored by Alejandro Rodríguez's avatar Alejandro Rodríguez

Adds a Gitaly n+1 notice to commit handling on access check

parent c49ad301
......@@ -162,14 +162,17 @@ module Gitlab
# if newrev is blank, the branch was deleted
return if deletion? || !(commit_validation || validate_path_locks?)
commits.each do |commit|
if commit_validation
error = check_commit(commit, push_rule)
raise GitAccess::UnauthorizedError, error if error
end
if error = check_commit_diff(commit, push_rule)
raise GitAccess::UnauthorizedError, error
# n+1: https://gitlab.com/gitlab-org/gitlab-ee/issues/3593
Gitlab::GitalyClient.allow_n_plus_1_calls do
commits.each do |commit|
if commit_validation
error = check_commit(commit, push_rule)
raise GitAccess::UnauthorizedError, error if error
end
if error = check_commit_diff(commit, push_rule)
raise GitAccess::UnauthorizedError, error
end
end
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