From 2dc11594d5b95d876c9997ca40dfb08bf06c830b Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Thu, 23 Oct 2014 17:33:49 +0100 Subject: Rework CachedRepo to use the GitDirectory class where possible This consolidates a bunch of code paths that were previously duplicated. This also changes the API for local cached repos to match the function names GitDirectory uses. Note that the remote repo cache still uses the old names, and should be fixed when time permits. Some unit tests that use the CachedRepo module required a bit of inelegant monkey-patching in order that they continue to work. A better way to do this would be with the 'mock' library (which would need to be added to Baserock 'build' and 'devel' systems before we could use it). --- morphlib/git.py | 9 --------- 1 file changed, 9 deletions(-) (limited to 'morphlib/git.py') diff --git a/morphlib/git.py b/morphlib/git.py index 6a5a9a47..944ddc30 100644 --- a/morphlib/git.py +++ b/morphlib/git.py @@ -275,15 +275,6 @@ def copy_repository(runcmd, repo, destdir, is_mirror=True): gitcmd(runcmd, 'remote', 'update', 'origin', '--prune', cwd=destdir) -def checkout_ref(runcmd, gitdir, ref): - '''Checks out a specific ref/SHA1 in a git working tree.''' - gitcmd(runcmd, 'checkout', ref, cwd=gitdir) - gd = morphlib.gitdir.GitDirectory(gitdir) - if gd.has_fat(): - gd.fat_init() - gd.fat_pull() - - def index_has_changes(runcmd, gitdir): '''Returns True if there are no staged changes to commit''' try: -- cgit v1.2.1