Skip to content

Commit

Permalink
Allowing different archive format types.
Browse files Browse the repository at this point in the history
Correcting incorrect comment about "content" key in array too.
  • Loading branch information
violuke authored May 5, 2017
1 parent 2709de9 commit 6a26445
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/Gitlab/Api/Repositories.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 6a26445

Please sign in to comment.