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