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
path: root/proto
diff options
context:
space:
mode:
authorPatrick Bajao <ebajao@gitlab.com>2021-06-08 13:40:41 +0300
committerPatrick Bajao <ebajao@gitlab.com>2021-06-08 13:40:41 +0300
commit8ea1987fd91810fe02bc3180f96729fddf5e74ee (patch)
tree997adbcdfadb08787d0ebef58dc8a288d19e6f09 /proto
parent3d7ad95c236e60009d1d1a3ba6a97bec12baabb6 (diff)
Auto-resolve other conflict scenarios when AllowConflicts is true
In order to be able to show diffs on based on the merge ref, we need to be able to automatically resolve conflicts when UserMergeToRef is called with AllowConflicts set to true. The mergeSubcommand.resolveConflicts has been modified to handle scenarios wherein there is a missing side of a conflict (whether it's our, their or the ancestor). This update is needed so we can show the MR diff even if there are conflicts. Before this change, we try to git-merge-file (via conflicts.MergeFile) using 3 versions of a file from ancestor, our, and their but that fails when one of them does not exist. With this change, we only do that when 2 of them are present. When 2 of those aren't present, we "manually" (in code) handle conflict resolution by keeping the changes in conflict.Their and rejecting other changes in conflict.Our and conflict.Ancestor as we don't want them to show up. Changelog: changed
Diffstat (limited to 'proto')
-rw-r--r--proto/go/gitalypb/operations.pb.go4
-rw-r--r--proto/operations.proto4
2 files changed, 6 insertions, 2 deletions
diff --git a/proto/go/gitalypb/operations.pb.go b/proto/go/gitalypb/operations.pb.go
index f40f084f2..5ef16f66e 100644
--- a/proto/go/gitalypb/operations.pb.go
+++ b/proto/go/gitalypb/operations.pb.go
@@ -872,7 +872,9 @@ type UserMergeToRefRequest struct {
// first parent of the computed merge. Overrides `branch`.
FirstParentRef []byte `protobuf:"bytes,7,opt,name=first_parent_ref,json=firstParentRef,proto3" json:"first_parent_ref,omitempty"`
// Allow conflicts to occur. Any conflict markers will be part of the merge commit.
- // Only text conflicts are handled, tree-based conflicts are not supported.
+ // When tree-based conflicts occur, no conflict markers will be added to the
+ // file on the merge commit. The `Their` side of the conflict will be kept and
+ // `Our` and `Ancestor` will be ignored.
AllowConflicts bool `protobuf:"varint,8,opt,name=allow_conflicts,json=allowConflicts,proto3" json:"allow_conflicts,omitempty"`
// timestamp is the optional timestamp to use for the merge commit. If it's
// not set, the current time will be used.
diff --git a/proto/operations.proto b/proto/operations.proto
index d1cf73ec3..1ead16681 100644
--- a/proto/operations.proto
+++ b/proto/operations.proto
@@ -270,7 +270,9 @@ message UserMergeToRefRequest {
// first parent of the computed merge. Overrides `branch`.
bytes first_parent_ref = 7;
// Allow conflicts to occur. Any conflict markers will be part of the merge commit.
- // Only text conflicts are handled, tree-based conflicts are not supported.
+ // When tree-based conflicts occur, no conflict markers will be added to the
+ // file on the merge commit. The `Their` side of the conflict will be kept and
+ // `Our` and `Ancestor` will be ignored.
bool allow_conflicts = 8;
// timestamp is the optional timestamp to use for the merge commit. If it's
// not set, the current time will be used.