Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOswaldo Ferreira <oswaldo@gitlab.com>2019-01-31 21:32:44 +0300
committerOswaldo Ferreira <oswaldo@gitlab.com>2019-02-25 16:40:58 +0300
commit1ad699677fa4b24a9bc002c6dc20164b8832bca5 (patch)
tree8018d8af35b14d78b20144788a0b271226347a9b /app/models/repository.rb
parent992183534dd1af54bf891789aca5777ea91c0942 (diff)
Support merge to ref for merge-commit and squash
Adds the ground work for writing into the merge ref refs/merge-requests/:iid/merge the merge result between source and target branches of a MR, without further side-effects such as mailing, MR updates and target branch changes.
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r--app/models/repository.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index ed55a6e572b..cd761a29618 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -854,6 +854,12 @@ class Repository
end
end
+ def merge_to_ref(user, source_sha, merge_request, target_ref, message)
+ branch = merge_request.target_branch
+
+ raw.merge_to_ref(user, source_sha, branch, target_ref, message)
+ end
+
def ff_merge(user, source, target_branch, merge_request: nil)
their_commit_id = commit(source)&.id
raise 'Invalid merge source' if their_commit_id.nil?