diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-04-12 17:19:31 +0100 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-04-12 17:19:31 +0100 |
commit | 2b1cff669a4a89fce54b134a61f121a1943ee06c (patch) | |
tree | b292bfbbeba5f76b4a36d91b3783b771f944e64f /morphlib | |
parent | f0753bb71d4be104bcedcd8899e368948df7ae1a (diff) | |
download | morph-2b1cff669a4a89fce54b134a61f121a1943ee06c.tar.gz |
Make copy_repository get a repo instead of treeish
This helps refactoring morph to get rid of treeishes.
Diffstat (limited to 'morphlib')
-rw-r--r-- | morphlib/builder.py | 2 | ||||
-rw-r--r-- | morphlib/git.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/morphlib/builder.py b/morphlib/builder.py index 4bbf4464..336a25b3 100644 --- a/morphlib/builder.py +++ b/morphlib/builder.py @@ -113,7 +113,7 @@ class Factory(object): logging.debug('Extracting %s into %s' % (treeish.repo, destdir)) if not os.path.exists(destdir): os.mkdir(destdir) - morphlib.git.copy_repository(treeish, destdir, msg) + morphlib.git.copy_repository(treeish.repo, destdir, msg) morphlib.git.checkout_ref(destdir, treeish.ref, msg) morphlib.git.reset_workdir(destdir, msg) return [(sub.treeish, os.path.join(destdir, sub.path)) diff --git a/morphlib/git.py b/morphlib/git.py index 0ee07259..8f9dfa94 100644 --- a/morphlib/git.py +++ b/morphlib/git.py @@ -242,10 +242,10 @@ def update_remote(gitdir, name, msg=logging.debug): ex = morphlib.execute.Execute(gitdir, msg=msg) return ex.runv(['git', 'remote', 'update', name]) -def copy_repository(treeish, destdir, msg=logging.debug): +def copy_repository(repo, destdir, msg=logging.debug): '''Copies a cached repository into a directory using cp.''' ex = morphlib.execute.Execute('.', msg=msg) - return ex.runv(['cp', '-a', os.path.join(treeish.repo, '.git'), destdir]) + return ex.runv(['cp', '-a', os.path.join(repo, '.git'), destdir]) def checkout_ref(gitdir, ref, msg=logging.debug): '''Checks out a specific ref/SHA1 in a git working tree.''' |