summaryrefslogtreecommitdiff
path: root/lorry
diff options
context:
space:
mode:
Diffstat (limited to 'lorry')
-rwxr-xr-xlorry7
1 files changed, 7 insertions, 0 deletions
diff --git a/lorry b/lorry
index 3b9f471..b9f72ea 100755
--- a/lorry
+++ b/lorry
@@ -523,6 +523,13 @@ class Lorry(cliapp.Application):
pushrefspecs=['refs/heads/*:refs/heads/*',
'refs/tags/*:refs/tags/*']):
pushurl = "%s/%s.git" % (self.settings['mirror-base-url-push'], name)
+
+ # If pushing to local filesystem, check if repo exists
+ if pushurl.startswith('/'):
+ if not os.path.isdir(pushurl):
+ self.progress('.. creating local repo for %s in %s' % (name, pushurl))
+ self.run_program(['git', 'init', '--bare', pushurl], cwd=gitdir)
+
self.progress('.. pushing %s to mirror server %s' % (name, pushurl))
self.run_program(['git', 'push', pushurl]+pushrefspecs, cwd=gitdir)