and a couple more awaits for necessary internals

This commit is contained in:
Brendan Forster
2016-04-06 20:10:20 -04:00
parent d3c43b77a9
commit c5600ce37b
3 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -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);
}
}
}
+1 -1
View File
@@ -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)
{
+1 -1
View File
@@ -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;