From fa7d75733cf8c861fd6ad479b0397877f5a08332 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Fri, 4 Oct 2013 12:38:49 +0200 Subject: Fix failed merge when filename is the same as target branchname. --- lib/gitlab/satellite/merge_action.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gitlab/satellite/merge_action.rb b/lib/gitlab/satellite/merge_action.rb index 156483be8dd..5d56852f058 100644 --- a/lib/gitlab/satellite/merge_action.rb +++ b/lib/gitlab/satellite/merge_action.rb @@ -149,7 +149,7 @@ module Gitlab # We can't trust the input here being branch names, we can't always check it out because it could be a relative ref i.e. HEAD~3 # we could actually remove the if true, because it should never ever happen (as long as the satellite has been prepared) repo.git.checkout(default_options, "#{merge_request.source_branch}") - repo.git.checkout(default_options, "#{merge_request.target_branch}") + repo.git.checkout(default_options({t: true}), "origin/#{merge_request.target_branch}") end rescue Grit::Git::CommandFailed => ex handle_exception(ex) -- cgit v1.2.1 From a817993439733dd6cd45fed82ddb7f145b1602d9 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Fri, 4 Oct 2013 13:26:48 +0200 Subject: Remove outdated comments. --- lib/gitlab/satellite/merge_action.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/gitlab/satellite/merge_action.rb b/lib/gitlab/satellite/merge_action.rb index 5d56852f058..d74d4194ff6 100644 --- a/lib/gitlab/satellite/merge_action.rb +++ b/lib/gitlab/satellite/merge_action.rb @@ -146,8 +146,6 @@ module Gitlab repo.remote_fetch('source') repo.git.checkout(default_options({b: true}), merge_request.target_branch, "origin/#{merge_request.target_branch}") else - # We can't trust the input here being branch names, we can't always check it out because it could be a relative ref i.e. HEAD~3 - # we could actually remove the if true, because it should never ever happen (as long as the satellite has been prepared) repo.git.checkout(default_options, "#{merge_request.source_branch}") repo.git.checkout(default_options({t: true}), "origin/#{merge_request.target_branch}") end -- cgit v1.2.1