Skip to content

Commit

Permalink
Make variable names consistent and move EditBranch() function to pres…
Browse files Browse the repository at this point in the history
…erve alphabetical ordering
  • Loading branch information
ryangribble committed Dec 13, 2015
1 parent 2f54078 commit 40caf23
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
6 changes: 3 additions & 3 deletions Octokit/Clients/IRepositoriesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,10 @@ public interface IRepositoriesClient
/// Edit the specified branch with the values given in <paramref name="update"/>
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="repositoryName">The name of the repository</param>
/// <param name="branchName">The name of the branch</param>
/// <param name="name">The name of the repository</param>
/// <param name="branch">The name of the branch</param>
/// <param name="update">New values to update the branch with</param>
/// <returns>The updated <see cref="T:Octokit.Branch"/></returns>
Task<Branch> EditBranch(string owner, string repositoryName, string branchName, BranchUpdate update);
Task<Branch> EditBranch(string owner, string name, string branch, BranchUpdate update);
}
}
38 changes: 19 additions & 19 deletions Octokit/Clients/RepositoriesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,25 @@ public Task<Repository> Edit(string owner, string name, RepositoryUpdate update)
return ApiConnection.Patch<Repository>(ApiUrls.Repository(owner, name), update);
}

/// <summary>
/// Edit the specified branch with the values given in <paramref name="update"/>
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="branch">The name of the branch</param>
/// <param name="update">New values to update the branch with</param>
/// <returns>The updated <see cref="T:Octokit.Branch"/></returns>
public Task<Branch> 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<Branch>(ApiUrls.RepoBranch(owner, name, branch), update, previewAcceptsHeader);
}

/// <summary>
/// Gets the specified repository.
/// </summary>
Expand Down Expand Up @@ -505,24 +524,5 @@ public Task<Branch> GetBranch(string owner, string repositoryName, string branch
const string previewAcceptsHeader = "application/vnd.github.loki-preview+json";
return ApiConnection.Get<Branch>(ApiUrls.RepoBranch(owner, repositoryName, branchName), null, previewAcceptsHeader);
}

/// <summary>
/// Edit the specified branch with the values given in <paramref name="update"/>
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="repositoryName">The name of the repository</param>
/// <param name="branchName">The name of the branch</param>
/// <param name="update">New values to update the branch with</param>
/// <returns>The updated <see cref="T:Octokit.Branch"/></returns>
public Task<Branch> 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<Branch>(ApiUrls.RepoBranch(owner, repositoryName, branchName), update, previewAcceptsHeader);
}
}
}

0 comments on commit 40caf23

Please sign in to comment.