diff options
author | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2019-07-09 12:17:33 +0100 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2019-07-09 12:17:33 +0100 |
commit | a44c6b4a5ddcc769eb7a6b2108b57df682753060 (patch) | |
tree | 68bdd7d34ea2f0b7befdc1416fb5afd97c29709c /lorry | |
parent | 2b9e5856dbfd7fd6dacbb0c92443d87b502dcc4b (diff) | |
download | lorry-a44c6b4a5ddcc769eb7a6b2108b57df682753060.tar.gz |
Create bare repo before pushing if local remote
Diffstat (limited to 'lorry')
-rwxr-xr-x | lorry | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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) |