Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0ca61d4

Browse files
ericmjonasempty
authored andcommitted
Fixed the gzip archive creation using python gzip module
(cherry picked from commit 160bd2bb74d88c110874c21635e24cc74ef58459)
1 parent5f23379 commit0ca61d4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎lib/git/repo.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
importos
88
importre
9+
importgzip
10+
importStringIO
911
fromerrorsimportInvalidGitRepositoryError,NoSuchPathError
1012
fromutilsimporttouch,is_git_dir
1113
fromcmdimportGit
@@ -386,7 +388,12 @@ def archive_tar_gz(self, treeish='master', prefix=None):
386388
kwargs= {}
387389
ifprefix:
388390
kwargs['prefix']=prefix
389-
self.git.archive(treeish,"| gzip",**kwargs)
391+
resultstr=self.git.archive(treeish,**kwargs)
392+
sio=StringIO.StringIO()
393+
gf=gzip.GzipFile(fileobj=sio,mode='wb')
394+
gf.write(resultstr)
395+
gf.close()
396+
returnsio.getvalue()
390397

391398
def_get_daemon_export(self):
392399
filename=os.path.join(self.path,self.DAEMON_EXPORT_FILE)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp