mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-05-31 18:13:21 +00:00
cleanup some indenting to make things a bit more readable
This commit is contained in:
@@ -93,7 +93,8 @@ namespace Octokit
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||
Ensure.ArgumentNotNull(comment, "comment");
|
||||
|
||||
var response = await ApiConnection.Connection.Post<PullRequestReviewComment>(ApiUrls.PullRequestReviewComments(owner, name, number), comment, null, null).ConfigureAwait(false);
|
||||
var endpoint = ApiUrls.PullRequestReviewComments(owner, name, number);
|
||||
var response = await ApiConnection.Connection.Post<PullRequestReviewComment>(endpoint, comment, null, null).ConfigureAwait(false);
|
||||
|
||||
if (response.HttpResponse.StatusCode != HttpStatusCode.Created)
|
||||
{
|
||||
@@ -118,7 +119,8 @@ namespace Octokit
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||
Ensure.ArgumentNotNull(comment, "comment");
|
||||
|
||||
var response = await ApiConnection.Connection.Post<PullRequestReviewComment>(ApiUrls.PullRequestReviewComments(owner, name, number), comment, null, null).ConfigureAwait(false);
|
||||
var endpoint = ApiUrls.PullRequestReviewComments(owner, name, number);
|
||||
var response = await ApiConnection.Connection.Post<PullRequestReviewComment>(endpoint, comment, null, null).ConfigureAwait(false);
|
||||
|
||||
if (response.HttpResponse.StatusCode != HttpStatusCode.Created)
|
||||
{
|
||||
|
||||
@@ -118,7 +118,8 @@ namespace Octokit
|
||||
|
||||
try
|
||||
{
|
||||
return await ApiConnection.Put<PullRequestMerge>(ApiUrls.MergePullRequest(owner, name, number), mergePullRequest).ConfigureAwait(false);
|
||||
var endpoint = ApiUrls.MergePullRequest(owner, name, number);
|
||||
return await ApiConnection.Put<PullRequestMerge>(endpoint, mergePullRequest).ConfigureAwait(false);
|
||||
}
|
||||
catch (ApiException ex)
|
||||
{
|
||||
@@ -151,8 +152,8 @@ namespace Octokit
|
||||
|
||||
try
|
||||
{
|
||||
var response = await Connection.Get<object>(ApiUrls.MergePullRequest(owner, name, number), null, null)
|
||||
.ConfigureAwait(false);
|
||||
var endpoint = ApiUrls.MergePullRequest(owner, name, number);
|
||||
var response = await Connection.Get<object>(endpoint, null, null).ConfigureAwait(false);
|
||||
return response.HttpResponse.IsTrue();
|
||||
}
|
||||
catch (NotFoundException)
|
||||
|
||||
@@ -518,9 +518,8 @@ namespace Octokit
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||
|
||||
var data = await ApiConnection
|
||||
.Get<Dictionary<string, long>>(ApiUrls.RepositoryLanguages(owner, name))
|
||||
.ConfigureAwait(false);
|
||||
var endpoint = ApiUrls.RepositoryLanguages(owner, name);
|
||||
var data = await ApiConnection.Get<Dictionary<string, long>>(endpoint).ConfigureAwait(false);
|
||||
|
||||
return new ReadOnlyCollection<RepositoryLanguage>(
|
||||
data.Select(kvp => new RepositoryLanguage(kvp.Key, kvp.Value)).ToList());
|
||||
|
||||
@@ -77,8 +77,8 @@ namespace Octokit
|
||||
|
||||
try
|
||||
{
|
||||
var subscription = await ApiConnection.Get<Subscription>(ApiUrls.Watched(owner, name))
|
||||
.ConfigureAwait(false);
|
||||
var endpoint = ApiUrls.Watched(owner, name);
|
||||
var subscription = await ApiConnection.Get<Subscription>(endpoint).ConfigureAwait(false);
|
||||
|
||||
return subscription != null;
|
||||
}
|
||||
@@ -117,8 +117,8 @@ namespace Octokit
|
||||
|
||||
try
|
||||
{
|
||||
var statusCode = await Connection.Delete(ApiUrls.Watched(owner, name))
|
||||
.ConfigureAwait(false);
|
||||
var endpoint = ApiUrls.Watched(owner, name);
|
||||
var statusCode = await Connection.Delete(endpoint).ConfigureAwait(false);
|
||||
|
||||
return statusCode == HttpStatusCode.NoContent;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,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");
|
||||
}
|
||||
|
||||
return await referencesClient.Create(owner, name, new NewReference("refs/heads/" + branchName, baseReference.Object.Sha)).ConfigureAwait(false);
|
||||
var newReference = new NewReference("refs/heads/" + branchName, baseReference.Object.Sha);
|
||||
return await referencesClient.Create(owner, name, newReference).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -51,7 +52,8 @@ namespace Octokit.Helpers
|
||||
}
|
||||
|
||||
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);
|
||||
var newReference = new NewReference("refs/heads/" + branchName, baseBranch.Object.Sha);
|
||||
return await referencesClient.Create(owner, name, newReference).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,8 +171,7 @@ namespace Octokit
|
||||
{
|
||||
Ensure.ArgumentNotNull(uri, "uri");
|
||||
|
||||
return _pagination.GetAllPages(async () => await GetPage<T>(uri, parameters, accepts)
|
||||
.ConfigureAwait(false), uri);
|
||||
return _pagination.GetAllPages(async () => await GetPage<T>(uri, parameters, accepts).ConfigureAwait(false), uri);
|
||||
}
|
||||
|
||||
public Task<IReadOnlyList<T>> GetAll<T>(Uri uri, IDictionary<string, string> parameters, string accepts, ApiOptions options)
|
||||
|
||||
Reference in New Issue
Block a user