Commit b0260165 authored by Patrick Steinhardt's avatar Patrick Steinhardt

git: Fix removal of nonexistent repositories

Gitaly has changed semantics of the RemoveRepository RPC call to return
an error in case the repository that is about to be deleted doesn't
exist anymore in commit f328e3f70 (repository: Implement atomic locking
semantics for RemoveRepository, 2021-11-30). This change was required
such that Gitaly can provide proper locking semantics for repositories,
but it has broken expectations on our side that removing a nonexisting
repository is an idempotent action.

Adapt to the semantic change by rescuing from `NoRepository` errors in
`Repository#remove`.
parent 43e8687d
......@@ -160,6 +160,8 @@ module Gitlab
wrapped_gitaly_errors do
gitaly_repository_client.remove
end
rescue NoRepository
nil
end
def replicate(source_repository)
......
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