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:
authorPatrick Bajao <ebajao@gitlab.com>2019-03-01 04:16:18 +0300
committerPatrick Bajao <ebajao@gitlab.com>2019-03-01 04:16:18 +0300
commitb094de2e0dc3ee80fe13a64aed8067d79ef3e24c (patch)
tree9322e30074351e2be546e51407888148599e93bb
parent00d8f64de6921202c2e61c60b50db78f5d59ec49 (diff)
Fix after rebase
-rw-r--r--internal/service/operations/commit_files_test.go34
-rw-r--r--vendor/gitlab.com/gitlab-org/gitaly-proto/go/gitalypb/operations.pb.go9
2 files changed, 24 insertions, 19 deletions
diff --git a/internal/service/operations/commit_files_test.go b/internal/service/operations/commit_files_test.go
index 6c58e0b5e..e26a05946 100644
--- a/internal/service/operations/commit_files_test.go
+++ b/internal/service/operations/commit_files_test.go
@@ -133,12 +133,6 @@ func TestSuccessfulUserCommitFilesRequest(t *testing.T) {
}
}
-func setAuthorAndEmail(headerRequest *gitalypb.UserCommitFilesRequest, authorName, authorEmail []byte) {
- header := headerRequest.UserCommitFilesRequestPayload.(*gitalypb.UserCommitFilesRequest_Header).Header
- header.CommitAuthorName = authorName
- header.CommitAuthorEmail = authorEmail
-}
-
func TestSuccessfulUserCommitFilesRequestMove(t *testing.T) {
server, serverSocketPath := runFullServer(t)
defer server.Stop()
@@ -232,10 +226,10 @@ func TestSuccessfulUserCommitFilesRequestForceCommit(t *testing.T) {
mergeBaseID := strings.TrimSuffix(string(mergeBaseOut), "\n")
require.NotEqual(t, mergeBaseID, targetBranchCommit.Id, "expected %s not to be an ancestor of %s", targetBranchCommit.Id, startBranchCommit.Id)
- headerRequest := headerRequest(testRepo, user, targetBranchName, commitFilesMessage, authorName, authorEmail)
- header := headerRequest.UserCommitFilesRequestPayload.(*gitalypb.UserCommitFilesRequest_Header).Header
- header.StartBranchName = startBranchName
- header.Force = true
+ headerRequest := headerRequest(testRepo, user, targetBranchName, commitFilesMessage)
+ setAuthorAndEmail(headerRequest, authorName, authorEmail)
+ setStartBranchName(headerRequest, startBranchName)
+ setForce(headerRequest, true)
stream, err := client.UserCommitFiles(ctx)
require.NoError(t, err)
@@ -436,6 +430,26 @@ func headerRequest(repo *gitalypb.Repository, user *gitalypb.User, branchName st
}
}
+func setAuthorAndEmail(headerRequest *gitalypb.UserCommitFilesRequest, authorName, authorEmail []byte) {
+ header := getHeader(headerRequest)
+ header.CommitAuthorName = authorName
+ header.CommitAuthorEmail = authorEmail
+}
+
+func setStartBranchName(headerRequest *gitalypb.UserCommitFilesRequest, startBranchName []byte) {
+ header := getHeader(headerRequest)
+ header.StartBranchName = startBranchName
+}
+
+func setForce(headerRequest *gitalypb.UserCommitFilesRequest, force bool) {
+ header := getHeader(headerRequest)
+ header.Force = force
+}
+
+func getHeader(headerRequest *gitalypb.UserCommitFilesRequest) *gitalypb.UserCommitFilesRequestHeader {
+ return headerRequest.UserCommitFilesRequestPayload.(*gitalypb.UserCommitFilesRequest_Header).Header
+}
+
func createFileHeaderRequest(filePath string) *gitalypb.UserCommitFilesRequest {
return actionRequest(&gitalypb.UserCommitFilesAction{
UserCommitFilesActionPayload: &gitalypb.UserCommitFilesAction_Header{
diff --git a/vendor/gitlab.com/gitlab-org/gitaly-proto/go/gitalypb/operations.pb.go b/vendor/gitlab.com/gitlab-org/gitaly-proto/go/gitalypb/operations.pb.go
index 371158860..8efcd213d 100644
--- a/vendor/gitlab.com/gitlab-org/gitaly-proto/go/gitalypb/operations.pb.go
+++ b/vendor/gitlab.com/gitlab-org/gitaly-proto/go/gitalypb/operations.pb.go
@@ -2612,15 +2612,6 @@ func (c *operationServiceClient) UserMergeToRef(ctx context.Context, in *UserMer
return out, nil
}
-func (c *operationServiceClient) UserMergeToRef(ctx context.Context, in *UserMergeToRefRequest, opts ...grpc.CallOption) (*UserMergeToRefResponse, error) {
- out := new(UserMergeToRefResponse)
- err := grpc.Invoke(ctx, "/gitaly.OperationService/UserMergeToRef", in, out, c.cc, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
func (c *operationServiceClient) UserMergeBranch(ctx context.Context, opts ...grpc.CallOption) (OperationService_UserMergeBranchClient, error) {
stream, err := c.cc.NewStream(ctx, &_OperationService_serviceDesc.Streams[0], "/gitaly.OperationService/UserMergeBranch", opts...)
if err != nil {