From 6ffdddf48bbd82155e0fe162e1e32011d9256604 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Tue, 13 Aug 2013 22:33:48 +0400 Subject: [PATCH] #265: small refactoring according to Alexander's comments --- app/models/pull_request.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/models/pull_request.rb b/app/models/pull_request.rb index b67b8bbbc..aaeec2e26 100644 --- a/app/models/pull_request.rb +++ b/app/models/pull_request.rb @@ -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