From 514ed613f3b68e90e86034870be477fffa52ea6b Mon Sep 17 00:00:00 2001 From: Henrik Andersson Date: Sat, 21 Mar 2015 23:32:58 +1000 Subject: [PATCH] Add another overload to GetArchiveLink --- Octokit/Clients/RepositoryContentsClient.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Octokit/Clients/RepositoryContentsClient.cs b/Octokit/Clients/RepositoryContentsClient.cs index a69b31f2..7b867f01 100644 --- a/Octokit/Clients/RepositoryContentsClient.cs +++ b/Octokit/Clients/RepositoryContentsClient.cs @@ -86,7 +86,23 @@ namespace Octokit /// public Task GetArchiveLink(string owner, string name) { - return GetArchiveLink(owner, name, ArchiveFormat.Tarball, "master"); + return GetArchiveLink(owner, name, ArchiveFormat.Tarball, string.Empty); + } + + /// + /// This method will return a 302 to a URL to download a tarball or zipball archive for a repository. + /// Please make sure your HTTP framework is configured to follow redirects or you will need to use the + /// Location header to make a second GET request. + /// Note: For private repositories, these links are temporary and expire quickly. + /// + /// https://developer.github.com/v3/repos/contents/#get-archive-link + /// The owner of the repository + /// The name of the repository + /// The format of the archive. Can be either tarball or zipball + /// + public Task GetArchiveLink(string owner, string name, ArchiveFormat archiveFormat) + { + return GetArchiveLink(owner, name, archiveFormat, string.Empty); } ///