diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-01-06 04:18:51 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-01-06 04:18:51 +0800 |
commit | a30f278bdee399346f199ada0e33f5c2d233d861 (patch) | |
tree | 01a584bad9f099e6af8cf784bfca3a616ba27add /app/services/commits | |
parent | ae86a1b9d3c9ca4ce592fa89085acd059ffc09a0 (diff) | |
download | gitlab-ce-a30f278bdee399346f199ada0e33f5c2d233d861.tar.gz |
Fix for initial commit and remove unneeded args
Diffstat (limited to 'app/services/commits')
-rw-r--r-- | app/services/commits/change_service.rb | 11 |
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 |