summaryrefslogtreecommitdiff
path: root/app/controllers/concerns/creates_commit.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-11-15 07:53:36 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-11-15 07:53:36 +0800
commita68a62011d03c15d6116dc1e6dcb9514040a51f5 (patch)
treeecd9922f9f7bccd34326ed600d0c6f1b69339036 /app/controllers/concerns/creates_commit.rb
parentd8fe2fac7e681ddbff3c7a5338f939eb2d540e38 (diff)
downloadgitlab-ce-a68a62011d03c15d6116dc1e6dcb9514040a51f5.tar.gz
Don't pass source_branch if it doesn't exist
Diffstat (limited to 'app/controllers/concerns/creates_commit.rb')
-rw-r--r--app/controllers/concerns/creates_commit.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/concerns/creates_commit.rb b/app/controllers/concerns/creates_commit.rb
index dacb5679dd3..643b61af1b2 100644
--- a/app/controllers/concerns/creates_commit.rb
+++ b/app/controllers/concerns/creates_commit.rb
@@ -4,9 +4,10 @@ module CreatesCommit
def create_commit(service, success_path:, failure_path:, failure_view: nil, success_notice: nil)
set_commit_variables
+ source_branch = @ref if @repository.find_branch(@ref)
commit_params = @commit_params.merge(
source_project: @project,
- source_branch: @ref,
+ source_branch: source_branch,
target_branch: @target_branch
)