diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2020-12-01 22:14:14 +0300 |
---|---|---|
committer | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2020-12-03 18:58:45 +0300 |
commit | 623bd3b5d43c1bb861f697bfa2b207964674e39a (patch) | |
tree | ad582ed865dd20812b7c6278aa492f153b9fa598 | |
parent | 17ff33207e3c0543f3e12e690131a8003bf2c84d (diff) |
UserDeleteBranch: move & add comments
Move a comment added in c3b327226 (Initial go implementation of
UserDeleteBranch, 2020-09-29) to reflect where we start the Go
codepath. Unlike UserCreateBranch we do some initial checks in the Go
code before handing things off to Ruby. Add a comment saying that this
is intentional.
-rw-r--r-- | internal/gitaly/service/operations/branches.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/gitaly/service/operations/branches.go b/internal/gitaly/service/operations/branches.go index cfc0579c2..4c74928ae 100644 --- a/internal/gitaly/service/operations/branches.go +++ b/internal/gitaly/service/operations/branches.go @@ -102,6 +102,9 @@ func (s *Server) UserUpdateBranch(ctx context.Context, req *gitalypb.UserUpdateB } func (s *Server) UserDeleteBranch(ctx context.Context, req *gitalypb.UserDeleteBranchRequest) (*gitalypb.UserDeleteBranchResponse, error) { + // That we do the branch name & user check here first only in + // UserDelete but not UserCreate is "intentional", i.e. it's + // always been that way. if len(req.BranchName) == 0 { return nil, status.Errorf(codes.InvalidArgument, "Bad Request (empty branch name)") } @@ -110,12 +113,11 @@ func (s *Server) UserDeleteBranch(ctx context.Context, req *gitalypb.UserDeleteB return nil, status.Errorf(codes.InvalidArgument, "Bad Request (empty user)") } + // Implement UserDeleteBranch in Go if featureflag.IsDisabled(ctx, featureflag.GoUserDeleteBranch) { return s.UserDeleteBranchRuby(ctx, req) } - // Implement UserDeleteBranch in Go - revision, err := git.NewRepository(req.Repository).GetBranch(ctx, string(req.BranchName)) if err != nil { return nil, helper.ErrPreconditionFailed(err) |