diff options
author | Sami Hiltunen <shiltunen@gitlab.com> | 2022-03-15 13:30:46 +0300 |
---|---|---|
committer | Sami Hiltunen <shiltunen@gitlab.com> | 2022-03-15 13:30:46 +0300 |
commit | d0d5fa790767c12eeadb40a1ecfbc00fde2a4768 (patch) | |
tree | 28a9e5c0790e992c4c3f8945d910047f23161d0a | |
parent | d7fcf59e9183da0785b81ff07e0bcf2ca7c115f8 (diff) | |
parent | 6c63998ad459ff840e82e636c93d2aa7e25fe982 (diff) |
Merge branch 'pks-user-squash-fix-error-code-with-improved-error-handling' into 'master'
operations: Fix wrong error code when UserSquash conflicts
See merge request gitlab-org/gitaly!4403
-rw-r--r-- | internal/gitaly/service/operations/squash.go | 2 | ||||
-rw-r--r-- | internal/gitaly/service/operations/squash_test.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/internal/gitaly/service/operations/squash.go b/internal/gitaly/service/operations/squash.go index 4a942a15e..b73bc58ba 100644 --- a/internal/gitaly/service/operations/squash.go +++ b/internal/gitaly/service/operations/squash.go @@ -193,7 +193,7 @@ func (s *Server) userSquash(ctx context.Context, req *gitalypb.UserSquashRequest } detailedErr, err := helper.ErrWithDetails( - helper.ErrInternalf("rebasing commits: %w", err), + helper.ErrFailedPreconditionf("rebasing commits: %w", err), &gitalypb.UserSquashError{ Error: &gitalypb.UserSquashError_RebaseConflict{ RebaseConflict: &gitalypb.MergeConflictError{ diff --git a/internal/gitaly/service/operations/squash_test.go b/internal/gitaly/service/operations/squash_test.go index 668503535..d0b111215 100644 --- a/internal/gitaly/service/operations/squash_test.go +++ b/internal/gitaly/service/operations/squash_test.go @@ -520,7 +520,7 @@ func testUserSquashConflicts(t *testing.T, ctx context.Context) { if featureflag.UserSquashImprovedErrorHandling.IsEnabled(ctx) { testhelper.RequireGrpcError(t, errWithDetails(t, - helper.ErrInternalf("rebasing commits: rebase: commit %q: there are conflicting files", ours), + helper.ErrFailedPreconditionf("rebasing commits: rebase: commit %q: there are conflicting files", ours), &gitalypb.UserSquashError{ Error: &gitalypb.UserSquashError_RebaseConflict{ RebaseConflict: &gitalypb.MergeConflictError{ |