summaryrefslogtreecommitdiff
path: root/morphlib/plugins/artifact_inspection_plugin.py
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-10-23 17:33:49 +0100
committerSam Thursfield <sam.thursfield@codethink.co.uk>2014-12-03 10:23:27 +0000
commit2dc11594d5b95d876c9997ca40dfb08bf06c830b (patch)
treec2752f38b17e765416dad9ea64688aad0e60d60a /morphlib/plugins/artifact_inspection_plugin.py
parentbb1960c7711a8a48bbaabd188158a3c5d7f0ff04 (diff)
downloadmorph-2dc11594d5b95d876c9997ca40dfb08bf06c830b.tar.gz
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).
Diffstat (limited to 'morphlib/plugins/artifact_inspection_plugin.py')
-rw-r--r--morphlib/plugins/artifact_inspection_plugin.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/morphlib/plugins/artifact_inspection_plugin.py b/morphlib/plugins/artifact_inspection_plugin.py
index 74645f41..2d1fe979 100644
--- a/morphlib/plugins/artifact_inspection_plugin.py
+++ b/morphlib/plugins/artifact_inspection_plugin.py
@@ -51,7 +51,7 @@ class ProjectVersionGuesser(object):
if self.lrc.has_repo(repo):
repository = self.lrc.get_repo(repo)
for filename in filenames:
- yield filename, repository.cat(ref, filename)
+ yield filename, repository.read_file(filename, ref)
elif self.rrc:
for filename in filenames:
yield filename, self.rrc.cat_file(repo, ref, filename)
@@ -153,7 +153,7 @@ class VersionGuesser(object):
repository = self.lrc.get_repo(repo)
if not self.app.settings['no-git-update']:
repository.update()
- tree = repository.ls_tree(ref)
+ tree = repository.list_files(ref=ref, recurse=False)
elif self.rrc:
repository = None
tree = self.rrc.ls_tree(repo, ref)