[refs #90] clean dir before clone

This commit is contained in:
Alexander Machehin 2012-11-14 21:46:59 +06:00
parent 8ad53f4c0b
commit 1afcef17c3
1 changed files with 2 additions and 1 deletions

View File

@ -176,10 +176,11 @@ class PullRequest < ActiveRecord::Base
def clone def clone
git = Grit::Git.new(path) git = Grit::Git.new(path)
unless git.exist? if new_record? || !git.exist?
#~ FileUtils.mkdir_p(path) #~ FileUtils.mkdir_p(path)
#~ system("git clone --local --no-hardlinks #{to_project.path} #{path}") #~ system("git clone --local --no-hardlinks #{to_project.path} #{path}")
options = {:bare => false, :shared => false, :branch => to_ref} # shared? options = {:bare => false, :shared => false, :branch => to_ref} # shared?
`rm -rf #{path}`
git.fs_mkdir('..') git.fs_mkdir('..')
git.clone(options, to_project.path, path) git.clone(options, to_project.path, path)
if to_project != from_project if to_project != from_project