From 34bb67003083c379e1dee600c70c24fcee4ca771 Mon Sep 17 00:00:00 2001 From: Ryan Gribble Date: Sun, 13 Dec 2015 23:05:30 +1000 Subject: [PATCH] Make variable names consistent and move EditBranch() function to preserve alphabetical ordering --- Octokit/Clients/IRepositoriesClient.cs | 6 ++-- Octokit/Clients/RepositoriesClient.cs | 38 +++++++++++++------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Octokit/Clients/IRepositoriesClient.cs b/Octokit/Clients/IRepositoriesClient.cs index a82880ea..2243dcd9 100644 --- a/Octokit/Clients/IRepositoriesClient.cs +++ b/Octokit/Clients/IRepositoriesClient.cs @@ -332,10 +332,10 @@ namespace Octokit /// Edit the specified branch with the values given in /// /// The owner of the repository - /// The name of the repository - /// The name of the branch + /// The name of the repository + /// The name of the branch /// New values to update the branch with /// The updated - Task EditBranch(string owner, string repositoryName, string branchName, BranchUpdate update); + Task EditBranch(string owner, string name, string branch, BranchUpdate update); } } diff --git a/Octokit/Clients/RepositoriesClient.cs b/Octokit/Clients/RepositoriesClient.cs index cf5cbae8..06cbdebd 100644 --- a/Octokit/Clients/RepositoriesClient.cs +++ b/Octokit/Clients/RepositoriesClient.cs @@ -161,6 +161,25 @@ namespace Octokit return ApiConnection.Patch(ApiUrls.Repository(owner, name), update); } + /// + /// Edit the specified branch with the values given in + /// + /// The owner of the repository + /// The name of the repository + /// The name of the branch + /// New values to update the branch with + /// The updated + public Task EditBranch(string owner, string name, string branch, BranchUpdate update) + { + Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); + Ensure.ArgumentNotNullOrEmptyString(name, "repositoryName"); + Ensure.ArgumentNotNullOrEmptyString(branch, "branchName"); + Ensure.ArgumentNotNull(update, "update"); + + const string previewAcceptsHeader = "application/vnd.github.loki-preview+json"; + return ApiConnection.Patch(ApiUrls.RepoBranch(owner, name, branch), update, previewAcceptsHeader); + } + /// /// Gets the specified repository. /// @@ -505,24 +524,5 @@ namespace Octokit const string previewAcceptsHeader = "application/vnd.github.loki-preview+json"; return ApiConnection.Get(ApiUrls.RepoBranch(owner, repositoryName, branchName), null, previewAcceptsHeader); } - - /// - /// Edit the specified branch with the values given in - /// - /// The owner of the repository - /// The name of the repository - /// The name of the branch - /// New values to update the branch with - /// The updated - public Task EditBranch(string owner, string repositoryName, string branchName, BranchUpdate update) - { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); - Ensure.ArgumentNotNullOrEmptyString(branchName, "branchName"); - Ensure.ArgumentNotNull(update, "update"); - - const string previewAcceptsHeader = "application/vnd.github.loki-preview+json"; - return ApiConnection.Patch(ApiUrls.RepoBranch(owner, repositoryName, branchName), update, previewAcceptsHeader); - } } }