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
# 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