public async Task<IPackage> DownloadAsync(Revision revision) { var request = new GetArchiveLinkRequest(AccountName, RepositoryName, revision, format: ArchiveFormat.Zipball); var link = await client.GetArchiveLink(request).ConfigureAwait(false); return await ZipPackage.FetchAsync(link, stripFirstLevel: true).ConfigureAwait(false); }
public async Task<ICommit> GetCommitAsync(Revision revision) { var commit = await client.GetCommitAsync(AccountName, RepositoryName, revision.Name).ConfigureAwait(false); if (commit == null) { throw new Exception($"The repository '{RepositoryName}' does not have a reference named '{revision.Path}'"); } return commit; }
public async Task<ICommit> GetCommitAsync(Revision revision) { var reference = await GetRefAsync(revision.Path).ConfigureAwait(false); if (reference == null) { throw new Exception($"The repository '{RepositoryName}' does not have a reference named '{revision.Path}'"); } return reference.Object.ToCommit(); }
public RepositoryInfo( RepositoryProviderId provider, string accountName, string name, Revision? revision) { Provider = provider; AccountName = accountName; Name = name; Revision = revision; }
public GetArchiveLinkRequest(string accountName, string repositoryName, Revision revision, ArchiveFormat format = ArchiveFormat.Zipball) { #region Preconditions if (accountName == null) throw new ArgumentNullException(nameof(accountName)); if (repositoryName == null) throw new ArgumentNullException(nameof(repositoryName)); #endregion AccountName = accountName; RepositoryName = repositoryName; Revision = revision; Format = format; }
public async Task<IPackage> DownloadAsync(Revision revision) { var stream = await client.GetZipStreamAsync(AccountName, RepositoryName, revision.Name).ConfigureAwait(false); return ZipPackage.FromStream(stream, stripFirstLevel: true); }