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>2020-12-02 14:48:39 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2020-12-02 14:59:35 +0300
commit5c107f34961e99bb80d6c8b09a6725499844b773 (patch)
treec0ed8ebefe581210f6f66e2b5521a952967b3242 /internal/gitaly/service/operations/merge.go
parenta5a5d83630f13c3eb3e1650a24423fc5e9bc47d2 (diff)
operations: Fix wrong ordering of merge parents for UserMergeBranch
While our tests do verify that generated merge commits from UserMergeBranch have expected merge parents, the order isn't verified at all. Unfortunately, ordering is important and not checking it has allowed us to sneak in a bug in the Go implementation which ordered parents the wrong way. Fix the test to verify order and fix the Go implementation to order merge parents correctly.
Diffstat (limited to 'internal/gitaly/service/operations/merge.go')
-rw-r--r--internal/gitaly/service/operations/merge.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/gitaly/service/operations/merge.go b/internal/gitaly/service/operations/merge.go
index 64c6ad276..93fd77829 100644
--- a/internal/gitaly/service/operations/merge.go
+++ b/internal/gitaly/service/operations/merge.go
@@ -123,8 +123,8 @@ func (s *Server) userMergeBranch(stream gitalypb.OperationService_UserMergeBranc
AuthorName: string(firstRequest.User.Name),
AuthorMail: string(firstRequest.User.Email),
Message: string(firstRequest.Message),
- Ours: firstRequest.CommitId,
- Theirs: revision,
+ Ours: revision,
+ Theirs: firstRequest.CommitId,
}.Run(ctx, s.cfg)
if err != nil {
if errors.Is(err, git2go.ErrInvalidArgument) {