Skip to content

Commit

Permalink
Merge pull request #187 from violuke/patch-1
Browse files Browse the repository at this point in the history
Allowing different archive format types
  • Loading branch information
m4tthumphrey authored Jun 6, 2017
2 parents a572f6b + 6a26445 commit 51242d8
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 51242d8

Please sign in to comment.