diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-06-14 12:34:34 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-06-15 09:46:59 +0300 |
commit | c0cc066c9356682d1ed7fb60b2fa42bbbe010d4e (patch) | |
tree | 397457e7ddf6f36b97733fd6b817501aeeee4fd7 | |
parent | fc261b66a9545acbebfbd87727471bbd18c325d9 (diff) |
operations: Remove check for specific error message
In UserMergeBranch we're verifying whether the error message returned by
`gitaly-git2go` contains a specific string to be able to discern the
case where the merge failed because of a merge conflict. This check is
not required anymore though given that we now always get a specific
`ConflictingFilesError{}` in that case.
Remove the check to clean up the logic.
-rw-r--r-- | internal/gitaly/service/operations/merge.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/gitaly/service/operations/merge.go b/internal/gitaly/service/operations/merge.go index c15ef49ac..b15c63867 100644 --- a/internal/gitaly/service/operations/merge.go +++ b/internal/gitaly/service/operations/merge.go @@ -85,10 +85,11 @@ func (s *Server) UserMergeBranch(stream gitalypb.OperationService_UserMergeBranc return helper.ErrInvalidArgument(err) } - if strings.Contains(err.Error(), "could not auto-merge due to conflicts") || errors.As(err, &git2go.ConflictingFilesError{}) { + if errors.As(err, &git2go.ConflictingFilesError{}) { return helper.ErrFailedPreconditionf("Failed to merge for source_sha %s into target_sha %s", firstRequest.CommitId, revision.String()) } + return helper.ErrInternal(err) } |