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:
authorLin Jen-Shin <godfat@godfat.org>2017-01-05 23:18:51 +0300
committerLin Jen-Shin <godfat@godfat.org>2017-01-05 23:18:51 +0300
commita30f278bdee399346f199ada0e33f5c2d233d861 (patch)
tree01a584bad9f099e6af8cf784bfca3a616ba27add /app/services/commits
parentae86a1b9d3c9ca4ce592fa89085acd059ffc09a0 (diff)
Fix for initial commit and remove unneeded args
Diffstat (limited to 'app/services/commits')
-rw-r--r--app/services/commits/change_service.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/services/commits/change_service.rb b/app/services/commits/change_service.rb
index 60bd59a5d9f..4a5d8029413 100644
--- a/app/services/commits/change_service.rb
+++ b/app/services/commits/change_service.rb
@@ -26,8 +26,15 @@ module Commits
def commit_change(action)
raise NotImplementedError unless repository.respond_to?(action)
- into = @create_merge_request ? @commit.public_send("#{action}_branch_name") : @target_branch
- tree_id = repository.public_send("check_#{action}_content", @commit, @target_branch)
+ if @create_merge_request
+ into = @commit.public_send("#{action}_branch_name")
+ tree_branch = @source_branch
+ else
+ into = tree_branch = @target_branch
+ end
+
+ tree_id = repository.public_send(
+ "check_#{action}_content", @commit, tree_branch)
if tree_id
validate_target_branch(into) if @create_merge_request