diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-11-26 15:08:21 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-12-01 17:12:07 +0300 |
commit | f1826df0476eef0c95538b7fc7be42afd084f215 (patch) | |
tree | 994a08d70e6d97457264ae25545f6bf4290f2a40 /internal/gitaly/service/operations | |
parent | ff5805ed00db7003e9fcb06a8aee883616b090b6 (diff) |
operations: Expose server type to allow testing it
As we're about to change some implementation details of
`server.updateReferenceWithHooks()`, we want to add a set of tests which
verifies that our changes actually make sense. But the type is currently
private and thus not returned by `NewServer()`, which makes it hard to
wire up a test server.
Fix the issue by making exposing the type to other modules and returning
it from `NewServer()` directly, which allows us to test non-public
methods of that type.
Diffstat (limited to 'internal/gitaly/service/operations')
-rw-r--r-- | internal/gitaly/service/operations/apply_patch.go | 2 | ||||
-rw-r--r-- | internal/gitaly/service/operations/branches.go | 10 | ||||
-rw-r--r-- | internal/gitaly/service/operations/cherry_pick.go | 2 | ||||
-rw-r--r-- | internal/gitaly/service/operations/commit_files.go | 10 | ||||
-rw-r--r-- | internal/gitaly/service/operations/merge.go | 12 | ||||
-rw-r--r-- | internal/gitaly/service/operations/rebase.go | 4 | ||||
-rw-r--r-- | internal/gitaly/service/operations/revert.go | 2 | ||||
-rw-r--r-- | internal/gitaly/service/operations/server.go | 7 | ||||
-rw-r--r-- | internal/gitaly/service/operations/squash.go | 24 | ||||
-rw-r--r-- | internal/gitaly/service/operations/submodules.go | 4 | ||||
-rw-r--r-- | internal/gitaly/service/operations/tags.go | 4 | ||||
-rw-r--r-- | internal/gitaly/service/operations/update_with_hooks.go | 2 |
12 files changed, 41 insertions, 42 deletions
diff --git a/internal/gitaly/service/operations/apply_patch.go b/internal/gitaly/service/operations/apply_patch.go index 2df086e9b..8b5b35c8c 100644 --- a/internal/gitaly/service/operations/apply_patch.go +++ b/internal/gitaly/service/operations/apply_patch.go @@ -9,7 +9,7 @@ import ( "google.golang.org/grpc/status" ) -func (s *server) UserApplyPatch(stream gitalypb.OperationService_UserApplyPatchServer) error { +func (s *Server) UserApplyPatch(stream gitalypb.OperationService_UserApplyPatchServer) error { firstRequest, err := stream.Recv() if err != nil { return err diff --git a/internal/gitaly/service/operations/branches.go b/internal/gitaly/service/operations/branches.go index e667c2686..2428f8f41 100644 --- a/internal/gitaly/service/operations/branches.go +++ b/internal/gitaly/service/operations/branches.go @@ -15,7 +15,7 @@ import ( "google.golang.org/grpc/status" ) -func (s *server) UserCreateBranch(ctx context.Context, req *gitalypb.UserCreateBranchRequest) (*gitalypb.UserCreateBranchResponse, error) { +func (s *Server) UserCreateBranch(ctx context.Context, req *gitalypb.UserCreateBranchRequest) (*gitalypb.UserCreateBranchResponse, error) { if featureflag.IsDisabled(ctx, featureflag.GoUserCreateBranch) { return s.UserCreateBranchRuby(ctx, req) } @@ -73,7 +73,7 @@ func (s *server) UserCreateBranch(ctx context.Context, req *gitalypb.UserCreateB }, nil } -func (s *server) UserCreateBranchRuby(ctx context.Context, req *gitalypb.UserCreateBranchRequest) (*gitalypb.UserCreateBranchResponse, error) { +func (s *Server) UserCreateBranchRuby(ctx context.Context, req *gitalypb.UserCreateBranchRequest) (*gitalypb.UserCreateBranchResponse, error) { client, err := s.ruby.OperationServiceClient(ctx) if err != nil { return nil, err @@ -87,7 +87,7 @@ func (s *server) UserCreateBranchRuby(ctx context.Context, req *gitalypb.UserCre return client.UserCreateBranch(clientCtx, req) } -func (s *server) UserUpdateBranch(ctx context.Context, req *gitalypb.UserUpdateBranchRequest) (*gitalypb.UserUpdateBranchResponse, error) { +func (s *Server) UserUpdateBranch(ctx context.Context, req *gitalypb.UserUpdateBranchRequest) (*gitalypb.UserUpdateBranchResponse, error) { client, err := s.ruby.OperationServiceClient(ctx) if err != nil { return nil, err @@ -101,7 +101,7 @@ func (s *server) UserUpdateBranch(ctx context.Context, req *gitalypb.UserUpdateB return client.UserUpdateBranch(clientCtx, req) } -func (s *server) UserDeleteBranch(ctx context.Context, req *gitalypb.UserDeleteBranchRequest) (*gitalypb.UserDeleteBranchResponse, error) { +func (s *Server) UserDeleteBranch(ctx context.Context, req *gitalypb.UserDeleteBranchRequest) (*gitalypb.UserDeleteBranchResponse, error) { if len(req.BranchName) == 0 { return nil, status.Errorf(codes.InvalidArgument, "Bad Request (empty branch name)") } @@ -136,7 +136,7 @@ func (s *server) UserDeleteBranch(ctx context.Context, req *gitalypb.UserDeleteB return &gitalypb.UserDeleteBranchResponse{}, nil } -func (s *server) UserDeleteBranchRuby(ctx context.Context, req *gitalypb.UserDeleteBranchRequest) (*gitalypb.UserDeleteBranchResponse, error) { +func (s *Server) UserDeleteBranchRuby(ctx context.Context, req *gitalypb.UserDeleteBranchRequest) (*gitalypb.UserDeleteBranchResponse, error) { client, err := s.ruby.OperationServiceClient(ctx) if err != nil { return nil, err diff --git a/internal/gitaly/service/operations/cherry_pick.go b/internal/gitaly/service/operations/cherry_pick.go index f8c7841a2..3c406abfd 100644 --- a/internal/gitaly/service/operations/cherry_pick.go +++ b/internal/gitaly/service/operations/cherry_pick.go @@ -9,7 +9,7 @@ import ( "google.golang.org/grpc/status" ) -func (s *server) UserCherryPick(ctx context.Context, req *gitalypb.UserCherryPickRequest) (*gitalypb.UserCherryPickResponse, error) { +func (s *Server) UserCherryPick(ctx context.Context, req *gitalypb.UserCherryPickRequest) (*gitalypb.UserCherryPickResponse, error) { if err := validateCherryPickOrRevertRequest(req); err != nil { return nil, status.Errorf(codes.InvalidArgument, "UserCherryPick: %v", err) } diff --git a/internal/gitaly/service/operations/commit_files.go b/internal/gitaly/service/operations/commit_files.go index acdab1d3e..11662e904 100644 --- a/internal/gitaly/service/operations/commit_files.go +++ b/internal/gitaly/service/operations/commit_files.go @@ -34,7 +34,7 @@ func errorWithStderr(err error, stderr *bytes.Buffer) error { // UserCommitFiles allows for committing from a set of actions. See the protobuf documentation // for details. -func (s *server) UserCommitFiles(stream gitalypb.OperationService_UserCommitFilesServer) error { +func (s *Server) UserCommitFiles(stream gitalypb.OperationService_UserCommitFilesServer) error { firstRequest, err := stream.Recv() if err != nil { return err @@ -155,7 +155,7 @@ func validatePath(rootPath, relPath string) (string, error) { return path, nil } -func (s *server) userCommitFiles(ctx context.Context, header *gitalypb.UserCommitFilesRequestHeader, stream gitalypb.OperationService_UserCommitFilesServer) error { +func (s *Server) userCommitFiles(ctx context.Context, header *gitalypb.UserCommitFilesRequestHeader, stream gitalypb.OperationService_UserCommitFilesServer) error { repoPath, err := s.locator.GetRepoPath(header.Repository) if err != nil { return fmt.Errorf("get repo path: %w", err) @@ -348,7 +348,7 @@ func (s *server) userCommitFiles(ctx context.Context, header *gitalypb.UserCommi }}) } -func (s *server) resolveParentCommit(ctx context.Context, local git.Repository, remote *gitalypb.Repository, targetBranch, targetBranchCommit, startBranch string) (string, error) { +func (s *Server) resolveParentCommit(ctx context.Context, local git.Repository, remote *gitalypb.Repository, targetBranch, targetBranchCommit, startBranch string) (string, error) { if remote == nil && startBranch == "" { return targetBranchCommit, nil } @@ -400,7 +400,7 @@ func (s *server) resolveParentCommit(ctx context.Context, local git.Repository, return commit, nil } -func (s *server) fetchMissingCommit(ctx context.Context, local, remote *gitalypb.Repository, commitID string) error { +func (s *Server) fetchMissingCommit(ctx context.Context, local, remote *gitalypb.Repository, commitID string) error { if _, err := git.NewRepository(local).ResolveRefish(ctx, commitID+"^{commit}"); err != nil { if !errors.Is(err, git.ErrReferenceNotFound) || remote == nil { return fmt.Errorf("lookup parent commit: %w", err) @@ -414,7 +414,7 @@ func (s *server) fetchMissingCommit(ctx context.Context, local, remote *gitalypb return nil } -func (s *server) fetchRemoteObject(ctx context.Context, local, remote *gitalypb.Repository, sha string) error { +func (s *Server) fetchRemoteObject(ctx context.Context, local, remote *gitalypb.Repository, sha string) error { env, err := gitalyssh.UploadPackEnv(ctx, &gitalypb.SSHUploadPackRequest{ Repository: remote, GitConfigOptions: []string{"uploadpack.allowAnySHA1InWant=true"}, diff --git a/internal/gitaly/service/operations/merge.go b/internal/gitaly/service/operations/merge.go index 06993c833..64c6ad276 100644 --- a/internal/gitaly/service/operations/merge.go +++ b/internal/gitaly/service/operations/merge.go @@ -16,7 +16,7 @@ import ( "gitlab.com/gitlab-org/gitaly/proto/go/gitalypb" ) -func (s *server) UserMergeBranch(bidi gitalypb.OperationService_UserMergeBranchServer) error { +func (s *Server) UserMergeBranch(bidi gitalypb.OperationService_UserMergeBranchServer) error { ctx := bidi.Context() if featureflag.IsEnabled(ctx, featureflag.GoUserMergeBranch) { @@ -95,7 +95,7 @@ func hookErrorFromStdoutAndStderr(sout string, serr string) string { return sout } -func (s *server) userMergeBranch(stream gitalypb.OperationService_UserMergeBranchServer) error { +func (s *Server) userMergeBranch(stream gitalypb.OperationService_UserMergeBranchServer) error { ctx := stream.Context() firstRequest, err := stream.Recv() @@ -195,7 +195,7 @@ func validateFFRequest(in *gitalypb.UserFFBranchRequest) error { return nil } -func (s *server) UserFFBranch(ctx context.Context, in *gitalypb.UserFFBranchRequest) (*gitalypb.UserFFBranchResponse, error) { +func (s *Server) UserFFBranch(ctx context.Context, in *gitalypb.UserFFBranchRequest) (*gitalypb.UserFFBranchResponse, error) { if err := validateFFRequest(in); err != nil { return nil, helper.ErrInvalidArgument(err) } @@ -257,7 +257,7 @@ func (s *server) UserFFBranch(ctx context.Context, in *gitalypb.UserFFBranchRequ }, nil } -func (s *server) userFFBranchRuby(ctx context.Context, in *gitalypb.UserFFBranchRequest) (*gitalypb.UserFFBranchResponse, error) { +func (s *Server) userFFBranchRuby(ctx context.Context, in *gitalypb.UserFFBranchRequest) (*gitalypb.UserFFBranchResponse, error) { client, err := s.ruby.OperationServiceClient(ctx) if err != nil { return nil, err @@ -298,7 +298,7 @@ func validateUserMergeToRefRequest(in *gitalypb.UserMergeToRefRequest) error { // userMergeToRef overwrites the given TargetRef to point to either Branch or // FirstParentRef. Afterwards, it performs a merge of SourceSHA with either // Branch or FirstParentRef and updates TargetRef to the merge commit. -func (s *server) userMergeToRef(ctx context.Context, request *gitalypb.UserMergeToRefRequest) (*gitalypb.UserMergeToRefResponse, error) { +func (s *Server) userMergeToRef(ctx context.Context, request *gitalypb.UserMergeToRefRequest) (*gitalypb.UserMergeToRefResponse, error) { repoPath, err := s.locator.GetPath(request.Repository) if err != nil { return nil, err @@ -357,7 +357,7 @@ func (s *server) userMergeToRef(ctx context.Context, request *gitalypb.UserMerge }, nil } -func (s *server) UserMergeToRef(ctx context.Context, in *gitalypb.UserMergeToRefRequest) (*gitalypb.UserMergeToRefResponse, error) { +func (s *Server) UserMergeToRef(ctx context.Context, in *gitalypb.UserMergeToRefRequest) (*gitalypb.UserMergeToRefResponse, error) { if err := validateUserMergeToRefRequest(in); err != nil { return nil, helper.ErrInvalidArgument(err) } diff --git a/internal/gitaly/service/operations/rebase.go b/internal/gitaly/service/operations/rebase.go index a2d369da1..00ed7c97f 100644 --- a/internal/gitaly/service/operations/rebase.go +++ b/internal/gitaly/service/operations/rebase.go @@ -11,7 +11,7 @@ import ( "gitlab.com/gitlab-org/gitaly/proto/go/gitalypb" ) -func (s *server) UserRebaseConfirmable(stream gitalypb.OperationService_UserRebaseConfirmableServer) error { +func (s *Server) UserRebaseConfirmable(stream gitalypb.OperationService_UserRebaseConfirmableServer) error { firstRequest, err := stream.Recv() if err != nil { return err @@ -33,7 +33,7 @@ func (s *server) UserRebaseConfirmable(stream gitalypb.OperationService_UserReba return nil } -func (s *server) userRebaseConfirmable(stream gitalypb.OperationService_UserRebaseConfirmableServer, firstRequest *gitalypb.UserRebaseConfirmableRequest, repository *gitalypb.Repository) error { +func (s *Server) userRebaseConfirmable(stream gitalypb.OperationService_UserRebaseConfirmableServer, firstRequest *gitalypb.UserRebaseConfirmableRequest, repository *gitalypb.Repository) error { ctx := stream.Context() client, err := s.ruby.OperationServiceClient(ctx) if err != nil { diff --git a/internal/gitaly/service/operations/revert.go b/internal/gitaly/service/operations/revert.go index 850c8e336..e3957a461 100644 --- a/internal/gitaly/service/operations/revert.go +++ b/internal/gitaly/service/operations/revert.go @@ -9,7 +9,7 @@ import ( "google.golang.org/grpc/status" ) -func (s *server) UserRevert(ctx context.Context, req *gitalypb.UserRevertRequest) (*gitalypb.UserRevertResponse, error) { +func (s *Server) UserRevert(ctx context.Context, req *gitalypb.UserRevertRequest) (*gitalypb.UserRevertResponse, error) { if err := validateCherryPickOrRevertRequest(req); err != nil { return nil, status.Errorf(codes.InvalidArgument, "UserRevert: %v", err) } diff --git a/internal/gitaly/service/operations/server.go b/internal/gitaly/service/operations/server.go index c366ba321..d3b8f868d 100644 --- a/internal/gitaly/service/operations/server.go +++ b/internal/gitaly/service/operations/server.go @@ -9,10 +9,9 @@ import ( "gitlab.com/gitlab-org/gitaly/internal/gitaly/hook" "gitlab.com/gitlab-org/gitaly/internal/gitaly/rubyserver" "gitlab.com/gitlab-org/gitaly/internal/storage" - "gitlab.com/gitlab-org/gitaly/proto/go/gitalypb" ) -type server struct { +type Server struct { cfg config.Cfg ruby *rubyserver.Server hookManager hook.Manager @@ -22,8 +21,8 @@ type server struct { } // NewServer creates a new instance of a grpc OperationServiceServer -func NewServer(cfg config.Cfg, rs *rubyserver.Server, hookManager hook.Manager, locator storage.Locator, conns *client.Pool) gitalypb.OperationServiceServer { - return &server{ +func NewServer(cfg config.Cfg, rs *rubyserver.Server, hookManager hook.Manager, locator storage.Locator, conns *client.Pool) *Server { + return &Server{ ruby: rs, cfg: cfg, hookManager: hookManager, diff --git a/internal/gitaly/service/operations/squash.go b/internal/gitaly/service/operations/squash.go index dd0322659..97e1e4a36 100644 --- a/internal/gitaly/service/operations/squash.go +++ b/internal/gitaly/service/operations/squash.go @@ -45,7 +45,7 @@ const ( gitlabWorktreesSubDir = "gitlab-worktree" ) -func (s *server) UserSquash(ctx context.Context, req *gitalypb.UserSquashRequest) (*gitalypb.UserSquashResponse, error) { +func (s *Server) UserSquash(ctx context.Context, req *gitalypb.UserSquashRequest) (*gitalypb.UserSquashResponse, error) { if err := validateUserSquashRequest(req); err != nil { return nil, status.Errorf(codes.InvalidArgument, "UserSquash: %v", err) } @@ -113,7 +113,7 @@ func (er gitError) Error() string { return er.ErrMsg + ": " + er.Err.Error() } -func (s *server) userSquashGo(ctx context.Context, req *gitalypb.UserSquashRequest) (*gitalypb.UserSquashResponse, error) { +func (s *Server) userSquashGo(ctx context.Context, req *gitalypb.UserSquashRequest) (*gitalypb.UserSquashResponse, error) { if strings.Contains(req.GetSquashId(), "/") { return nil, helper.ErrInvalidArgument(errors.New("worktree id can't contain slashes")) } @@ -140,7 +140,7 @@ func (s *server) userSquashGo(ctx context.Context, req *gitalypb.UserSquashReque return &gitalypb.UserSquashResponse{SquashSha: sha}, nil } -func (s *server) runUserSquashGo(ctx context.Context, req *gitalypb.UserSquashRequest, env []string, repoPath string) (string, error) { +func (s *Server) runUserSquashGo(ctx context.Context, req *gitalypb.UserSquashRequest, env []string, repoPath string) (string, error) { sparseDiffFiles, err := s.diffFiles(ctx, env, repoPath, req) if err != nil { return "", fmt.Errorf("define diff files: %w", err) @@ -163,7 +163,7 @@ func (s *server) runUserSquashGo(ctx context.Context, req *gitalypb.UserSquashRe return sha, nil } -func (s *server) diffFiles(ctx context.Context, env []string, repoPath string, req *gitalypb.UserSquashRequest) ([]byte, error) { +func (s *Server) diffFiles(ctx context.Context, env []string, repoPath string, req *gitalypb.UserSquashRequest) ([]byte, error) { var stdout, stderr bytes.Buffer cmd, err := git.SafeBareCmd(ctx, git.CmdStream{Out: &stdout, Err: &stderr}, env, []git.Option{git.ValueFlag{Name: "--git-dir", Value: repoPath}}, @@ -186,7 +186,7 @@ func (s *server) diffFiles(ctx context.Context, env []string, repoPath string, r var errNoFilesCheckedOut = errors.New("no files checked out") -func (s *server) userSquashWithDiffInFiles(ctx context.Context, req *gitalypb.UserSquashRequest, repoPath string, env []string, diffFilesOut []byte) (string, error) { +func (s *Server) userSquashWithDiffInFiles(ctx context.Context, req *gitalypb.UserSquashRequest, repoPath string, env []string, diffFilesOut []byte) (string, error) { repo := req.GetRepository() worktreePath := newSquashWorktreePath(repoPath, req.GetSquashId()) @@ -239,7 +239,7 @@ func (s *server) userSquashWithDiffInFiles(ctx context.Context, req *gitalypb.Us return sha, nil } -func (s *server) checkout(ctx context.Context, repo *gitalypb.Repository, worktreePath string, req *gitalypb.UserSquashRequest) error { +func (s *Server) checkout(ctx context.Context, repo *gitalypb.Repository, worktreePath string, req *gitalypb.UserSquashRequest) error { var stderr bytes.Buffer checkoutCmd, err := git.SafeBareCmdInDir(ctx, worktreePath, git.CmdStream{Err: &stderr}, nil, nil, git.SubCmd{ @@ -264,7 +264,7 @@ func (s *server) checkout(ctx context.Context, repo *gitalypb.Repository, worktr return nil } -func (s *server) revParseGitDir(ctx context.Context, worktreePath string) (string, error) { +func (s *Server) revParseGitDir(ctx context.Context, worktreePath string) (string, error) { var stdout, stderr bytes.Buffer cmd, err := git.SafeBareCmdInDir(ctx, worktreePath, git.CmdStream{Out: &stdout, Err: &stderr}, nil, nil, git.SubCmd{ Name: "rev-parse", @@ -281,7 +281,7 @@ func (s *server) revParseGitDir(ctx context.Context, worktreePath string) (strin return text.ChompBytes(stdout.Bytes()), nil } -func (s *server) userSquashWithNoDiff(ctx context.Context, req *gitalypb.UserSquashRequest, repoPath string, env []string) (string, error) { +func (s *Server) userSquashWithNoDiff(ctx context.Context, req *gitalypb.UserSquashRequest, repoPath string, env []string) (string, error) { repo := req.GetRepository() worktreePath := newSquashWorktreePath(repoPath, req.GetSquashId()) @@ -306,7 +306,7 @@ func (s *server) userSquashWithNoDiff(ctx context.Context, req *gitalypb.UserSqu return sha, nil } -func (s *server) addWorktree(ctx context.Context, repo *gitalypb.Repository, worktreePath string, committish string) error { +func (s *Server) addWorktree(ctx context.Context, repo *gitalypb.Repository, worktreePath string, committish string) error { if err := runCmd(ctx, repo, "config", []git.Option{git.ConfigPair{Key: "core.splitIndex", Value: "false"}}, nil); err != nil { return fmt.Errorf("on 'git config core.splitIndex false': %w", err) } @@ -336,7 +336,7 @@ func (s *server) addWorktree(ctx context.Context, repo *gitalypb.Repository, wor return nil } -func (s *server) removeWorktree(ctx context.Context, repo *gitalypb.Repository, worktreeName string) error { +func (s *Server) removeWorktree(ctx context.Context, repo *gitalypb.Repository, worktreeName string) error { cmd, err := git.SafeCmd(ctx, repo, nil, git.SubCmd{ Name: "worktree", @@ -356,7 +356,7 @@ func (s *server) removeWorktree(ctx context.Context, repo *gitalypb.Repository, return nil } -func (s *server) applyDiff(ctx context.Context, repo *gitalypb.Repository, req *gitalypb.UserSquashRequest, worktreePath string, env []string) (string, error) { +func (s *Server) applyDiff(ctx context.Context, repo *gitalypb.Repository, req *gitalypb.UserSquashRequest, worktreePath string, env []string) (string, error) { diffRange := diffRange(req) var diffStderr bytes.Buffer @@ -443,7 +443,7 @@ func (s *server) applyDiff(ctx context.Context, repo *gitalypb.Repository, req * return text.ChompBytes(revParseStdout.Bytes()), nil } -func (s *server) createSparseCheckoutFile(worktreeGitPath string, diffFilesOut []byte) error { +func (s *Server) createSparseCheckoutFile(worktreeGitPath string, diffFilesOut []byte) error { if err := os.MkdirAll(filepath.Join(worktreeGitPath, "info"), 0755); err != nil { return fmt.Errorf("create 'info' dir for worktree %q: %w", worktreeGitPath, err) } diff --git a/internal/gitaly/service/operations/submodules.go b/internal/gitaly/service/operations/submodules.go index 3e9ce0f77..e3458af21 100644 --- a/internal/gitaly/service/operations/submodules.go +++ b/internal/gitaly/service/operations/submodules.go @@ -21,7 +21,7 @@ import ( const userUpdateSubmoduleName = "UserUpdateSubmodule" -func (s *server) UserUpdateSubmodule(ctx context.Context, req *gitalypb.UserUpdateSubmoduleRequest) (*gitalypb.UserUpdateSubmoduleResponse, error) { +func (s *Server) UserUpdateSubmodule(ctx context.Context, req *gitalypb.UserUpdateSubmoduleRequest) (*gitalypb.UserUpdateSubmoduleResponse, error) { if err := validateUserUpdateSubmoduleRequest(req); err != nil { return nil, status.Errorf(codes.InvalidArgument, userUpdateSubmoduleName+": %v", err) } @@ -75,7 +75,7 @@ func validateUserUpdateSubmoduleRequest(req *gitalypb.UserUpdateSubmoduleRequest return nil } -func (s *server) userUpdateSubmodule(ctx context.Context, req *gitalypb.UserUpdateSubmoduleRequest) (*gitalypb.UserUpdateSubmoduleResponse, error) { +func (s *Server) userUpdateSubmodule(ctx context.Context, req *gitalypb.UserUpdateSubmoduleRequest) (*gitalypb.UserUpdateSubmoduleResponse, error) { repo := git.NewRepository(req.GetRepository()) branches, err := repo.GetBranches(ctx) if err != nil { diff --git a/internal/gitaly/service/operations/tags.go b/internal/gitaly/service/operations/tags.go index 0523d98ee..d1f08c816 100644 --- a/internal/gitaly/service/operations/tags.go +++ b/internal/gitaly/service/operations/tags.go @@ -7,7 +7,7 @@ import ( "gitlab.com/gitlab-org/gitaly/proto/go/gitalypb" ) -func (s *server) UserDeleteTag(ctx context.Context, req *gitalypb.UserDeleteTagRequest) (*gitalypb.UserDeleteTagResponse, error) { +func (s *Server) UserDeleteTag(ctx context.Context, req *gitalypb.UserDeleteTagRequest) (*gitalypb.UserDeleteTagResponse, error) { client, err := s.ruby.OperationServiceClient(ctx) if err != nil { return nil, err @@ -21,7 +21,7 @@ func (s *server) UserDeleteTag(ctx context.Context, req *gitalypb.UserDeleteTagR return client.UserDeleteTag(clientCtx, req) } -func (s *server) UserCreateTag(ctx context.Context, req *gitalypb.UserCreateTagRequest) (*gitalypb.UserCreateTagResponse, error) { +func (s *Server) UserCreateTag(ctx context.Context, req *gitalypb.UserCreateTagRequest) (*gitalypb.UserCreateTagResponse, error) { client, err := s.ruby.OperationServiceClient(ctx) if err != nil { return nil, err diff --git a/internal/gitaly/service/operations/update_with_hooks.go b/internal/gitaly/service/operations/update_with_hooks.go index 4621f54a9..273f36dc8 100644 --- a/internal/gitaly/service/operations/update_with_hooks.go +++ b/internal/gitaly/service/operations/update_with_hooks.go @@ -30,7 +30,7 @@ func (e updateRefError) Error() string { return fmt.Sprintf("Could not update %s. Please refresh and try again.", e.reference) } -func (s *server) updateReferenceWithHooks(ctx context.Context, repo *gitalypb.Repository, user *gitalypb.User, reference, newrev, oldrev string) error { +func (s *Server) updateReferenceWithHooks(ctx context.Context, repo *gitalypb.Repository, user *gitalypb.User, reference, newrev, oldrev string) error { gitlabshellEnv, err := gitlabshell.EnvFromConfig(s.cfg) if err != nil { return err |