public IObservable <Branch> EditBranch(string owner, string name, string branch, BranchUpdate update) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(name, "name"); Ensure.ArgumentNotNullOrEmptyString(branch, "branch"); Ensure.ArgumentNotNull(update, "update"); return(_client.EditBranch(owner, name, branch, update).ToObservable()); }
public async Task CreateTheWorld() { // Set master branch to be protected, with some status checks var requiredStatusChecks = new RequiredStatusChecks(EnforcementLevel.Everyone, new List <string> { "check1", "check2" }); var update = new BranchUpdate(); update.Protection = new BranchProtection(true, requiredStatusChecks); var newBranch = await _fixture.EditBranch(_context.Repository.Owner.Login, _context.Repository.Name, "master", 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 IObservable <Branch> EditBranch(string owner, string name, string branch, BranchUpdate update) { return(_client.EditBranch(owner, name, branch, update).ToObservable()); }