diff options
-rw-r--r-- | morphlib/builder.py | 3 | ||||
-rw-r--r-- | morphlib/git.py | 8 |
2 files changed, 6 insertions, 5 deletions
diff --git a/morphlib/builder.py b/morphlib/builder.py index 396aa827..a9004a33 100644 --- a/morphlib/builder.py +++ b/morphlib/builder.py @@ -311,7 +311,8 @@ class ChunkBuilder(BlobBuilder): self.dump_memory_profile('before creating source and tarball ' 'for chunk') tarball = self.cache_prefix + '.src.tar' - morphlib.git.export_sources(self.blob.morph.treeish, tarball) + morphlib.git.export_sources(self.blob.morph.treeish, tarball, + msg=self.msg) self.dump_memory_profile('after exporting sources') os.mkdir(self.builddir) self.ex.runv(['tar', '-C', self.builddir, '-xf', tarball]) diff --git a/morphlib/git.py b/morphlib/git.py index e49c2b0f..9a03dbed 100644 --- a/morphlib/git.py +++ b/morphlib/git.py @@ -87,11 +87,11 @@ class Treeish(object): except (TypeError, morphlib.execute.CommandFailure): raise InvalidTreeish(self.original_repo, ref) -def export_sources(treeish, tar_filename): +def export_sources(treeish, tar_filename, msg=logging.debug): '''Export the contents of a specific commit into a compressed tarball.''' - ex = morphlib.execute.Execute('.', msg=logging.debug) - ex.runv(['git', 'archive', '-o', tar_filename, '--remote', - 'file://%s' % treeish.repo, treeish.sha1]) + ex = morphlib.execute.Execute('.', msg=msg) + ex.env['GIT_DIR'] = os.path.join(treeish.repo, '.git') + ex.runv(['git', 'archive', '-o', tar_filename, treeish.sha1]) def get_morph_text(treeish, filename, msg=logging.debug): '''Return a morphology from a git repository.''' |