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 Steinhardt <psteinhardt@gitlab.com>2021-06-09 12:02:57 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2021-06-09 20:11:02 +0300
commite88d3f30c2d5ee7bb4059c28cb9776bba927b69e (patch)
tree804419188d5f12fc54b8b55746ec0d321acfd322
parentdc956109aa3e352cadc55ebba267b43fdd4fdc27 (diff)
operations: Rename variable in UserMergeToRef
The `sourceRef` variable really contains the resolved commit ID of the source revision and is thus misnamed. Rename it to `sourceOID` to make clear what it contains.
-rw-r--r--internal/gitaly/service/operations/merge.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/gitaly/service/operations/merge.go b/internal/gitaly/service/operations/merge.go
index 3c8773532..7ab270821 100644
--- a/internal/gitaly/service/operations/merge.go
+++ b/internal/gitaly/service/operations/merge.go
@@ -251,7 +251,7 @@ func (s *Server) UserMergeToRef(ctx context.Context, request *gitalypb.UserMerge
return nil, helper.ErrInvalidArgument(errors.New("Invalid merge source"))
}
- sourceRef, err := repo.ResolveRevision(ctx, git.Revision(request.SourceSha))
+ sourceOID, err := repo.ResolveRevision(ctx, git.Revision(request.SourceSha))
if err != nil {
//nolint:stylecheck
return nil, helper.ErrInvalidArgument(errors.New("Invalid merge source"))
@@ -278,14 +278,15 @@ func (s *Server) UserMergeToRef(ctx context.Context, request *gitalypb.UserMerge
AuthorDate: authorDate,
Message: string(request.Message),
Ours: oid.String(),
- Theirs: sourceRef.String(),
+ Theirs: sourceOID.String(),
AllowConflicts: request.AllowConflicts,
}.Run(ctx, s.cfg)
if err != nil {
if errors.Is(err, git2go.ErrInvalidArgument) {
return nil, helper.ErrInvalidArgument(err)
}
- return nil, helper.ErrPreconditionFailedf("Failed to create merge commit for source_sha %s and target_sha %s at %s", sourceRef, oid, string(request.TargetRef))
+ return nil, helper.ErrPreconditionFailedf("Failed to create merge commit for source_sha %s and target_sha %s at %s",
+ sourceOID, oid, string(request.TargetRef))
}
mergeOID, err := git.NewObjectIDFromHex(merge.CommitID)