#265: small refactoring according to Alexander's comments

This commit is contained in:
Vokhmin Alexey V 2013-08-13 22:33:48 +04:00
parent 01098152e9
commit 6ffdddf48b
1 changed files with 2 additions and 6 deletions

View File

@ -53,12 +53,8 @@ class PullRequest < ActiveRecord::Base
FileUtils.mv path(old_from_project_name), path, :force => true if old_from_project_name
return unless Dir.exists?(path)
Dir.chdir(path) do
system 'git', 'remote', 'remove', 'origin'
system 'git', 'remote', 'add', 'origin', to_project.path
if cross_pull?
system 'git', 'remote', 'remove', 'head'
system 'git', 'remote', 'add', 'head', from_project.path
end
system 'git', 'remote', 'set-url', 'origin', to_project.path
system 'git', 'remote', 'set-url', 'head', from_project.path if cross_pull?
end
end
later :update_relations, :queue => :clone_build