From edf957c5fe043f48219bdbcf6fe4cdec5edff640 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Fri, 15 Jan 2016 14:02:48 +0000 Subject: lorry: Mirror without touching config We can do everything we need to on the command-line, which makes more sense than syncing lorry file config every time, and it makes it easier to add extra options later. Change-Id: Ieaabc9fe7a83b5c29371ddb92b991d128c90e6c6 --- lorry | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/lorry b/lorry index 78a2ef5..43a58f7 100755 --- a/lorry +++ b/lorry @@ -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') -- cgit v1.2.1