cleanup some indenting to make things a bit more readable

This commit is contained in:
Brendan Forster
2016-04-06 20:17:39 -04:00
parent c5600ce37b
commit b751a3e44f
6 changed files with 19 additions and 16 deletions
@@ -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)
{
+4 -3
View File
@@ -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)
+2 -3
View File
@@ -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());
+4 -4
View File
@@ -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;
}
+4 -2
View File
@@ -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);
}
}
}
+1 -2
View File
@@ -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)