8000 Project.archive(): download tarball of the project · mrodden/python-gitlab@debe41a · GitHub
[go: up one dir, main page]

Skip to content

Commit debe41a

Browse files
author
Gauvain Pocentek
committed
Project.archive(): download tarball of the project
1 parent 1cc7b17 commit debe41a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

gitlab.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,16 @@ def blob(self, sha, filepath):
943943

944944
raise GitlabGetError
945945

946+
def archive(self, sha=None):
947+
url = '/projects/%s/repository/archive' % self.id
948+
if sha:
949+
url += '?sha=%s' % sha
950+
r = self.gitlab.rawGet(url)
951+
if r.status_code == 200:
952+
return r.content
953+
954+
raise GitlabGetError
955+
946956

947957
class TeamMember(GitlabObject):
948958
_url = '/user_teams/%(team_id)s/members'

0 commit comments

Comments
 (0)
0