diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-11-22 13:14:41 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-11-22 14:18:16 +0300 |
commit | b82f415f09dd67da010a8c08397a13499e70efeb (patch) | |
tree | a94495045ccad1870fbce5826fa6b61c92afea73 /app/services/create_branch_service.rb | |
parent | d4d138ee707a2a7fdeef711db66f27088a4f6de1 (diff) |
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.rb | 8 |
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) |