From a44c6b4a5ddcc769eb7a6b2108b57df682753060 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Tue, 9 Jul 2019 12:17:33 +0100 Subject: Create bare repo before pushing if local remote --- lorry | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lorry') 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) -- cgit v1.2.1