diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-06-28 12:44:34 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-06-28 12:55:41 +0300 |
commit | 664d244680d83cd3d9a3b52c21239d04b2ab2ac3 (patch) | |
tree | abfe8b9ac3ba0bd63261e9df98e7bf238e4d3000 | |
parent | 6d32a81bc028feccddabdb5a6c369b72afa1ccaf (diff) |
operations: Return structured error for old-style conflict error
The gitaly-git2go command knows to return two different styles of
conflict errors depending on whether the `CherryPickStructuderErrors`
feature flag is set or not. This is done to help zero-downtime upgrades:
we can't yet return the new-style error when the old Gitaly server is
still running.
Because the server controls the binary it shouldn't ever happen that the
binary doesn't see the feature flag while the server does. It's thus
pointless to handle the old-style `HasConflictsError` on the server side
if the flag is enabled: this rather indicates an unexpected programming
error, and we should treat it as such.
Remove special handling of this error condition to clarify this.
-rw-r--r-- | internal/gitaly/service/operations/cherry_pick.go | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/internal/gitaly/service/operations/cherry_pick.go b/internal/gitaly/service/operations/cherry_pick.go index b7cc58ec8..b35a078b8 100644 --- a/internal/gitaly/service/operations/cherry_pick.go +++ b/internal/gitaly/service/operations/cherry_pick.go @@ -69,11 +69,6 @@ func (s *Server) UserCherryPick(ctx context.Context, req *gitalypb.UserCherryPic var emptyErr git2go.EmptyError switch { - case errors.As(err, &git2go.HasConflictsError{}): - return &gitalypb.UserCherryPickResponse{ - CreateTreeError: err.Error(), - CreateTreeErrorCode: gitalypb.UserCherryPickResponse_CONFLICT, - }, nil case errors.As(err, &conflictErr): conflictingFiles := make([][]byte, 0, len(conflictErr.ConflictingFiles)) for _, conflictingFile := range conflictErr.ConflictingFiles { |