summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/backup/repository.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/backup/repository.rb b/lib/backup/repository.rb
index 0bb02f1a357..faa1b3b4099 100644
--- a/lib/backup/repository.rb
+++ b/lib/backup/repository.rb
@@ -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