mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-03 11:05:56 +00:00
and a couple more awaits for necessary internals
This commit is contained in:
@@ -29,7 +29,7 @@ namespace Octokit.Helpers
|
||||
throw new ArgumentException(String.Format(CultureInfo.InvariantCulture, "The specified branch name '{0}' appears to be a ref name and not a branch name because it starts with the string 'refs/heads'. Either specify just the branch name or use the Create method if you need to specify the full ref name", branchName), "branchName");
|
||||
}
|
||||
|
||||
return await referencesClient.Create(owner, name, new NewReference("refs/heads/" + branchName, baseReference.Object.Sha));
|
||||
return await referencesClient.Create(owner, name, new NewReference("refs/heads/" + branchName, baseReference.Object.Sha)).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -50,8 +50,8 @@ namespace Octokit.Helpers
|
||||
throw new ArgumentException(String.Format(CultureInfo.InvariantCulture, "The specified branch name '{0}' appears to be a ref name and not a branch name because it starts with the string 'refs/heads'. Either specify just the branch name or use the Create method if you need to specify the full ref name", branchName), "branchName");
|
||||
}
|
||||
|
||||
var baseBranch = await referencesClient.Get(owner, name, "heads/master");
|
||||
return await referencesClient.Create(owner, name, new NewReference("refs/heads/" + branchName, baseBranch.Object.Sha));
|
||||
var baseBranch = await referencesClient.Get(owner, name, "heads/master").ConfigureAwait(false);
|
||||
return await referencesClient.Create(owner, name, new NewReference("refs/heads/" + branchName, baseBranch.Object.Sha)).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -494,7 +494,7 @@ namespace Octokit
|
||||
public async Task<string> GetRedirect(Uri uri)
|
||||
{
|
||||
Ensure.ArgumentNotNull(uri, "uri");
|
||||
var response = await Connection.GetRedirect<string>(uri);
|
||||
var response = await Connection.GetRedirect<string>(uri).ConfigureAwait(false);
|
||||
|
||||
if (response.HttpResponse.StatusCode == HttpStatusCode.Redirect)
|
||||
{
|
||||
|
||||
@@ -178,7 +178,7 @@ namespace Octokit.Internal
|
||||
|
||||
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
|
||||
{
|
||||
var response = await base.SendAsync(request, cancellationToken);
|
||||
var response = await base.SendAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
// Can't redirect without somewhere to redirect too. Throw?
|
||||
if (response.Headers.Location == null) return response;
|
||||
|
||||
Reference in New Issue
Block a user