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:
authorAlejandro Rodríguez <alejorro70@gmail.com>2017-10-23 20:16:10 +0300
committerAlejandro Rodríguez <alejorro70@gmail.com>2017-10-24 20:31:52 +0300
commita64601b9298d4b79bfc5d4f782b4dcc79ff33b74 (patch)
treeffeffae342bff5a8de96922d35d90c151bac546b /lib/gitlab/git/repository.rb
parent00c15cc27c33dd387069fce5777beb29d01f55ac (diff)
Move all rugged operation for ff_merge inside Gitlab::Git
We also delete some unused code related to the aforementioned feature.
Diffstat (limited to 'lib/gitlab/git/repository.rb')
-rw-r--r--lib/gitlab/git/repository.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb
index 59a54b48ed9..95265b41878 100644
--- a/lib/gitlab/git/repository.rb
+++ b/lib/gitlab/git/repository.rb
@@ -745,6 +745,16 @@ module Gitlab
nil
end
+ def ff_merge(user, source_sha, target_branch)
+ OperationService.new(user, self).with_branch(target_branch) do |our_commit|
+ raise ArgumentError, 'Invalid merge target' unless our_commit
+
+ source_sha
+ end
+ rescue Rugged::ReferenceError
+ raise ArgumentError, 'Invalid merge source'
+ end
+
def revert(user:, commit:, branch_name:, message:, start_branch_name:, start_repository:)
OperationService.new(user, self).with_branch(
branch_name,