Merge pull request #8299 from dandric-activevideo/bug8271

Fix for #8271: Correctly restore empty repositories.
This commit is contained in:
Jacob Vosmaer 2014-11-13 15:34:51 +01:00
commit 4e65d085b5
1 changed files with 7 additions and 1 deletions

View File

@ -59,7 +59,13 @@ module Backup
project.namespace.ensure_dir_exist if project.namespace
if system(*%W(git clone --bare #{path_to_bundle(project)} #{path_to_repo(project)}), silent)
if File.exists?(path_to_bundle(project))
cmd = %W(git clone --bare #{path_to_bundle(project)} #{path_to_repo(project)})
else
cmd = %W(git init --bare #{path_to_repo(project)})
end
if system(*cmd, silent)
puts "[DONE]".green
else
puts "[FAILED]".red