From 014a029ade9a045a839ca86c35690b218098ea33 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Thu, 3 Mar 2016 15:56:40 +0000 Subject: Get rid of the CachedRepo class (almost) For a long time the CachedRepo class has basically been a wrapper around the GitDir class, but with a few extra methods that don't really even belong there. It is now a tiny class in the localrepocache module which just keeps track of a few extra attributes. All other functionality is provided by the gitdir module. This commit also removes the `git clone` approach for copying repos out of the cache. The alternative approach implemented by git.copy_repository() was slightly faster when I tested, so for now we should use that everywhere. Longer term we should find out why this is quicker than `git clone`, and fix Git itself to be fast. Change-Id: I1686ab43253d44c3903d9a0bad8bb75528e9cf75 --- morphlib/plugins/anchor_plugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'morphlib/plugins/anchor_plugin.py') diff --git a/morphlib/plugins/anchor_plugin.py b/morphlib/plugins/anchor_plugin.py index 62c66c15..7465c479 100644 --- a/morphlib/plugins/anchor_plugin.py +++ b/morphlib/plugins/anchor_plugin.py @@ -140,7 +140,7 @@ class AnchorPlugin(cliapp.Plugin): repo = bc.lrc.get_updated_repo(reponame, refs=(s.original_ref for s in sources)) - remote = Remote(repo.gitdir) + remote = Remote(repo) push_url = resolver.push_url(reponame) remote.set_push_url(push_url) @@ -178,7 +178,7 @@ class AnchorPlugin(cliapp.Plugin): lsinfo = dict((ref, sha1) for (sha1, ref) in remote.ls()) for flag, sha1, target, summary, reason in results: - commit = repo.gitdir.resolve_ref_to_commit(sha1) + commit = repo.resolve_ref_to_commit(sha1) # Fail if we failed to push something other than a tag # pushed to a branch -- cgit v1.2.1