[refs #90] clean dir before clone
This commit is contained in:
parent
8ad53f4c0b
commit
1afcef17c3
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue