Commit b2ef5746 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'n-plus-1-notice' into 'master'

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

See merge request gitlab-org/gitlab-ee!3034
parents 0586ea1c 725d921d
...@@ -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