Skip to content

Implement GetArchive #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 17, 2018
Merged

Implement GetArchive #93

merged 2 commits into from
Aug 17, 2018

Conversation

eriknstevenson
Copy link
Contributor

Adds a GetArchive function for Clients which downloads compressed contents of a repository. This is based on the documentation in the wiki.

repo_file.go Outdated
// GetArchive downloads the full contents of a repository. Ref can be a branch/tag/commit.
func (c *Client) GetArchive(user, repo, ref, format string) ([]byte, error) {
if format != ".zip" && format != ".tar.gz" {
return nil, fmt.Errorf("Invalid format: %s (Must be .zip or .tar.gz)", format)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/Invalid format: %s (Must be .zip or .tar.gz)/invalid format: %s (must be .zip or .tar.gz)/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@eriknstevenson
Copy link
Contributor Author

Thanks for taking a look

@unknwon
Copy link
Member

unknwon commented Aug 17, 2018

Thank you!

@unknwon unknwon merged commit c84e492 into gogs:master Aug 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants