Commit a4cf560c authored by Nick Thomas's avatar Nick Thomas

Remove a Gitaly allow_disk_access call

The implementation was fixed in this MR:
https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/21238

However, the allowlist and issue reference was never removed.

I also take the opportunity to add a comment explaining that the user
must have permission to update the branch, since that wasn't very clear
to me when reading through this code.
parent 70b03b1d
......@@ -142,10 +142,10 @@ module Projects
newrev = upstream.dereferenced_target.sha
oldrev = local.dereferenced_target.sha
# Gitaly migration: https://gitlab.com/gitlab-org/gitaly/issues/1246
::Gitlab::GitalyClient::StorageSettings.allow_disk_access do
repository.update_branch(branch_name, user: current_user, newrev: newrev, oldrev: oldrev)
end
# If the user doesn't have permission to update the diverged branch
# (e.g. it's protected and the user can't force-push to protected
# branches), this will fail.
repository.update_branch(branch_name, user: current_user, newrev: newrev, oldrev: oldrev)
elsif branch_name == project.default_branch
# Cannot be updated
errors << "The default branch (#{project.default_branch}) has diverged from its upstream counterpart and could not be updated automatically."
......
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