summaryrefslogtreecommitdiff
path: root/morphlib/git.py
diff options
context:
space:
mode:
authorJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-02-02 15:29:18 +0000
committerJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-02-02 15:29:18 +0000
commit764e536e00100a57d4c3ea5e0d48336633c28378 (patch)
tree9b1258e7739b860bbf5e63314ab1981cc9cd682d /morphlib/git.py
parentc9d1c2d25370d4a12a8e6a575cce4e48338f8866 (diff)
downloadmorph-764e536e00100a57d4c3ea5e0d48336633c28378.tar.gz
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.
Diffstat (limited to 'morphlib/git.py')
-rw-r--r--morphlib/git.py8
1 files changed, 4 insertions, 4 deletions
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.'''