public BlobClientTests() { var github = Helper.GetAuthenticatedClient(); _fixture = github.Git.Blob; _context = github.CreateRepositoryContext("public-repo").Result; }
public BlobClientTests() { var client = Helper.GetAuthenticatedClient(); _fixture = client.GitDatabase.Blob; var repoName = Helper.MakeNameWithTimestamp("public-repo"); _repository = client.Repository.Create(new NewRepository { Name = repoName, AutoInit = true }).Result; _owner = _repository.Owner.Login; }
public BlobClientTests() { var client = new GitHubClient(new ProductHeaderValue("OctokitTests")) { Credentials = Helper.Credentials }; _fixture = client.GitDatabase.Blob; var repoName = Helper.MakeNameWithTimestamp("public-repo"); _repository = client.Repository.Create(new NewRepository { Name = repoName, AutoInit = true }).Result; _owner = _repository.Owner.Login; }
public static async Task <string> GetFileContentAsync( this IBlobsClient blobsClient, string repoOwner, string repoName, string fileSha) { Blob fileBlob = await blobsClient.Get(repoOwner, repoName, fileSha); switch (fileBlob.Encoding.Value) { case EncodingType.Utf8: return(fileBlob.Content); case EncodingType.Base64: byte[] bytes = Convert.FromBase64String(fileBlob.Content); return(Encoding.UTF8.GetString(bytes)); default: throw new NotSupportedException( $"The blob for file SHA '{fileSha}' in repo '{repoOwner}/{repoName}' uses an unsupported encoding: {fileBlob.Encoding}"); } }
public ObservableBlobClient(IGitHubClient client) { Ensure.ArgumentNotNull(client, "client"); _client = client.GitDatabase.Blob; }
public ObservableBlobClient(IGitHubClient client) { Ensure.ArgumentNotNull(client, nameof(client)); _client = client.Git.Blob; }