diff options
author | Eric Jonas <jonas@mit.edu> | 2009-01-14 22:51:40 -0500 |
---|---|---|
committer | Michael Trier <mtrier@gmail.com> | 2009-01-24 10:39:58 -0500 |
commit | 0ca61d4c68dad68901f8a7364dd210ef27a8b4c6 (patch) | |
tree | b992298adfb778adce5d3b2e38fa81d97b27d6de | |
parent | 5f23379c496942ea6fe898a7a823b65530c126a7 (diff) | |
download | gitpython-0ca61d4c68dad68901f8a7364dd210ef27a8b4c6.tar.gz |
Fixed the gzip archive creation using python gzip module
(cherry picked from commit 160bd2bb74d88c110874c21635e24cc74ef58459)
-rw-r--r-- | lib/git/repo.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/git/repo.py b/lib/git/repo.py index 2d0fb973..da18208c 100644 --- a/lib/git/repo.py +++ b/lib/git/repo.py @@ -6,6 +6,8 @@ import os import re +import gzip +import StringIO from errors import InvalidGitRepositoryError, NoSuchPathError from utils import touch, is_git_dir from cmd import Git @@ -386,7 +388,12 @@ class Repo(object): kwargs = {} if prefix: kwargs['prefix'] = prefix - self.git.archive(treeish, "| gzip", **kwargs) + resultstr = self.git.archive(treeish, **kwargs) + sio = StringIO.StringIO() + gf = gzip.GzipFile(fileobj=sio, mode ='wb') + gf.write(resultstr) + gf.close() + return sio.getvalue() def _get_daemon_export(self): filename = os.path.join(self.path, self.DAEMON_EXPORT_FILE) |