Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Okstad <pokstad@gitlab.com>2020-12-15 20:53:27 +0300
committerPaul Okstad <pokstad@gitlab.com>2020-12-15 20:53:27 +0300
commite7af6836dbbda1b791d2336f6d8986d4f0aac5a1 (patch)
treeb7cfb78670996f76b0a433504714252fc7380077
parent84f04b8241de21a20cdcd42b4575c1894074e1d6 (diff)
parentbe093ba33a8444a97735fca013237050cbb9740d (diff)
Merge branch 'avar/user-branch-and-tag-ferry-update-ref-errors-upwards' into 'master'
User{Branch,Tag,Submodule}: ferry update-ref errors upwards See merge request gitlab-org/gitaly!2926
-rw-r--r--changelogs/unreleased/avar-user-branch-and-tag-ferry-update-ref-errors-upwards.yml5
-rw-r--r--internal/gitaly/service/operations/branches.go11
-rw-r--r--internal/gitaly/service/operations/submodules.go9
-rw-r--r--internal/gitaly/service/operations/tags.go6
4 files changed, 31 insertions, 0 deletions
diff --git a/changelogs/unreleased/avar-user-branch-and-tag-ferry-update-ref-errors-upwards.yml b/changelogs/unreleased/avar-user-branch-and-tag-ferry-update-ref-errors-upwards.yml
new file mode 100644
index 000000000..d11aa131c
--- /dev/null
+++ b/changelogs/unreleased/avar-user-branch-and-tag-ferry-update-ref-errors-upwards.yml
@@ -0,0 +1,5 @@
+---
+title: 'User{Branch,Tag,Submodule}: ferry update-ref errors upwards'
+merge_request: 2926
+author:
+type: fixed
diff --git a/internal/gitaly/service/operations/branches.go b/internal/gitaly/service/operations/branches.go
index 9d2bdf8ab..7da311fc5 100644
--- a/internal/gitaly/service/operations/branches.go
+++ b/internal/gitaly/service/operations/branches.go
@@ -62,6 +62,11 @@ func (s *Server) UserCreateBranch(ctx context.Context, req *gitalypb.UserCreateB
}, nil
}
+ var updateRefError updateRefError
+ if errors.As(err, &updateRefError) {
+ return nil, status.Error(codes.FailedPrecondition, err.Error())
+ }
+
return nil, err
}
@@ -138,6 +143,12 @@ func (s *Server) UserDeleteBranch(ctx context.Context, req *gitalypb.UserDeleteB
PreReceiveError: preReceiveError.message,
}, nil
}
+
+ var updateRefError updateRefError
+ if errors.As(err, &updateRefError) {
+ return nil, status.Error(codes.FailedPrecondition, err.Error())
+ }
+
return nil, err
}
diff --git a/internal/gitaly/service/operations/submodules.go b/internal/gitaly/service/operations/submodules.go
index e3458af21..cad3ec270 100644
--- a/internal/gitaly/service/operations/submodules.go
+++ b/internal/gitaly/service/operations/submodules.go
@@ -156,6 +156,15 @@ func (s *Server) userUpdateSubmodule(ctx context.Context, req *gitalypb.UserUpda
PreReceiveError: preReceiveError.Error(),
}, nil
}
+
+ var updateRefError updateRefError
+ if errors.As(err, &updateRefError) {
+ return &gitalypb.UserUpdateSubmoduleResponse{
+ CommitError: err.Error(),
+ }, nil
+ }
+
+ return nil, err
}
return &gitalypb.UserUpdateSubmoduleResponse{
diff --git a/internal/gitaly/service/operations/tags.go b/internal/gitaly/service/operations/tags.go
index b951cb035..071f9f8d8 100644
--- a/internal/gitaly/service/operations/tags.go
+++ b/internal/gitaly/service/operations/tags.go
@@ -56,6 +56,12 @@ func (s *Server) UserDeleteTagGo(ctx context.Context, req *gitalypb.UserDeleteTa
PreReceiveError: preReceiveError.message,
}, nil
}
+
+ var updateRefError updateRefError
+ if errors.As(err, &updateRefError) {
+ return nil, status.Error(codes.FailedPrecondition, err.Error())
+ }
+
return nil, err
}