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