From 764e536e00100a57d4c3ea5e0d48336633c28378 Mon Sep 17 00:00:00 2001 From: Jannis Pohlmann Date: Thu, 2 Feb 2012 15:29:18 +0000 Subject: Set GIT_DIR when running git archive. Drop --remote. This change is necessary because upstream git no longer allows --remote to be combined with an arbitrary SHA1. --- morphlib/git.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'morphlib/git.py') 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.''' -- cgit v1.2.1