From 6a264455e0ae198d21510441447d579aa34a1f02 Mon Sep 17 00:00:00 2001 From: Luke Cousins Date: Fri, 5 May 2017 13:00:42 +0100 Subject: [PATCH] Allowing different archive format types. Correcting incorrect comment about "content" key in array too. --- lib/Gitlab/Api/Repositories.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/Gitlab/Api/Repositories.php b/lib/Gitlab/Api/Repositories.php index 5894229ad..bb6e842e8 100644 --- a/lib/Gitlab/Api/Repositories.php +++ b/lib/Gitlab/Api/Repositories.php @@ -337,16 +337,14 @@ public function contributors($project_id) } /** - * File content is base64 encoded and placed in the "content" index of the returning array. - * You can then save the content with the tar.gz extension - * * @param int $project_id * @param array $params + * @param string $format Options: "tar.gz", "zip", "tar.bz2" and "tar" * @return mixed */ - public function archive($project_id, $params = array()) + public function archive($project_id, $params = array(), $format = 'tar.gz') { - return $this->get($this->getProjectPath($project_id, 'repository/archive'), $params); + return $this->get($this->getProjectPath($project_id, 'repository/archive.'.$format), $params); } /**