diff options
-rwxr-xr-x | lorry | 23 |
1 files changed, 3 insertions, 20 deletions
@@ -319,26 +319,9 @@ class Lorry(cliapp.Application): self.progress('.. initialising git dir') self.run_program(['git', 'init', '--bare', gitdir]) self.progress('.. updating existing clone') - if 'remote.origin.fetch' in self.run_program(['git', 'config', '-l'], - cwd=gitdir): - self.run_program(['git', 'config', '--unset-all', - 'remote.origin.fetch'], cwd=gitdir) - self.run_program(['git', 'config', 'remote.origin.url', - spec['url']], cwd=gitdir) - self.run_program(['git', 'config', 'remote.origin.mirror', 'true'], - cwd=gitdir) - self.run_program(['git', 'config', '--add', 'remote.origin.fetch', - '+refs/heads/*:refs/heads/*'], cwd=gitdir) - self.run_program(['git', 'config', '--add', 'remote.origin.fetch', - '+refs/tags/*:refs/tags/*'], cwd=gitdir) - try: - self.run_program(['git', 'remote', 'update', 'origin', '--prune'], - cwd=gitdir, env=env) - except: - self.run_program(['git', 'remote', 'prune', 'origin'], - cwd=gitdir, env=env) - self.run_program(['git', 'remote', 'update', 'origin', '--prune'], - cwd=gitdir, env=env) + argv = ['git', 'fetch', '--prune', spec['url'], + '+refs/heads/*:refs/heads/*', '+refs/tags/*:refs/tags/*'] + self.run_program(argv, cwd=gitdir, env=env) def gitify_bzr(self, project_name, dirname, gitdir, spec): bzrdir = os.path.join(dirname, 'bzr') |