diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-11-22 18:14:41 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-11-22 19:18:16 +0800 |
commit | b82f415f09dd67da010a8c08397a13499e70efeb (patch) | |
tree | a94495045ccad1870fbce5826fa6b61c92afea73 /app/services/files | |
parent | d4d138ee707a2a7fdeef711db66f27088a4f6de1 (diff) | |
download | gitlab-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/files')
-rw-r--r-- | app/services/files/base_service.rb | 13 | ||||
-rw-r--r-- | app/services/files/update_service.rb | 1 |
2 files changed, 2 insertions, 12 deletions
diff --git a/app/services/files/base_service.rb b/app/services/files/base_service.rb index 8689c83d40e..6779bd2818a 100644 --- a/app/services/files/base_service.rb +++ b/app/services/files/base_service.rb @@ -23,7 +23,7 @@ module Files validate # Create new branch if it different from source_branch - ensure_target_branch if different_branch? + validate_target_branch if different_branch? result = commit if result @@ -71,17 +71,6 @@ module Files end end - def ensure_target_branch - validate_target_branch - - if @source_project != project - # Make sure we have the source_branch in target project, - # and use source_branch as target_branch directly to avoid - # unnecessary source branch in target project. - @project.fetch_ref(@source_project, @target_branch, @source_branch) - end - end - def validate_target_branch result = ValidateNewBranchService.new(project, current_user). execute(@target_branch) diff --git a/app/services/files/update_service.rb b/app/services/files/update_service.rb index f3a766ed9fd..14e5af4d8c6 100644 --- a/app/services/files/update_service.rb +++ b/app/services/files/update_service.rb @@ -11,6 +11,7 @@ module Files message: @commit_message, author_email: @author_email, author_name: @author_name, + source_project: @source_project, source_branch: @source_branch) end |