summaryrefslogtreecommitdiff
path: root/app/services/create_branch_service.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-11-22 18:14:41 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-11-22 19:18:16 +0800
commitb82f415f09dd67da010a8c08397a13499e70efeb (patch)
treea94495045ccad1870fbce5826fa6b61c92afea73 /app/services/create_branch_service.rb
parentd4d138ee707a2a7fdeef711db66f27088a4f6de1 (diff)
downloadgitlab-ce-b82f415f09dd67da010a8c08397a13499e70efeb.tar.gz
Move all branch creation to raw_ensure_branch,
and keep it only called in update_branch_with_hooks.
Diffstat (limited to 'app/services/create_branch_service.rb')
-rw-r--r--app/services/create_branch_service.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/app/services/create_branch_service.rb b/app/services/create_branch_service.rb
index ecb5994fab8..b2bc3626c0f 100644
--- a/app/services/create_branch_service.rb
+++ b/app/services/create_branch_service.rb
@@ -1,16 +1,12 @@
require_relative 'base_service'
class CreateBranchService < BaseService
- def execute(branch_name, ref, source_project: @project)
+ def execute(branch_name, ref)
failure = validate_new_branch(branch_name)
return failure if failure
- new_branch = if source_project != @project
- @project.fetch_ref(source_project, branch_name, ref)
- else
- repository.add_branch(current_user, branch_name, ref)
- end
+ new_branch = repository.add_branch(current_user, branch_name, ref)
if new_branch
success(new_branch)