diff --git a/Octokit.Reactive/Clients/IObservableRepositoriesClient.cs b/Octokit.Reactive/Clients/IObservableRepositoriesClient.cs
index 761ab72ba4..6685a4264e 100644
--- a/Octokit.Reactive/Clients/IObservableRepositoriesClient.cs
+++ b/Octokit.Reactive/Clients/IObservableRepositoriesClient.cs
@@ -221,58 +221,6 @@ public interface IObservableRepositoriesClient
///
IObservableMergingClient Merging { get; }
- ///
- /// Gets all the branches for the specified repository.
- ///
- ///
- /// See the API documentation for more details
- ///
- /// The owner of the repository
- /// The name of the repository
- /// Thrown when a general API error occurs.
- /// All es of the repository
- [Obsolete("Please use ObservableRepositoriesClient.Branch.GetAll() instead. This method will be removed in a future version")]
- IObservable GetAllBranches(string owner, string name);
-
- ///
- /// Gets all the branches for the specified repository.
- ///
- ///
- /// See the API documentation for more details
- ///
- /// The Id of the repository
- /// Thrown when a general API error occurs.
- /// All es of the repository
- [Obsolete("Please use ObservableRepositoriesClient.Branch.GetAll() instead. This method will be removed in a future version")]
- IObservable GetAllBranches(long repositoryId);
-
- ///
- /// Gets all the branches for the specified repository.
- ///
- ///
- /// See the API documentation for more details
- ///
- /// The owner of the repository
- /// The name of the repository
- /// Options for changing the API response
- /// Thrown when a general API error occurs.
- /// All es of the repository
- [Obsolete("Please use ObservableRepositoriesClient.Branch.GetAll() instead. This method will be removed in a future version")]
- IObservable GetAllBranches(string owner, string name, ApiOptions options);
-
- ///
- /// Gets all the branches for the specified repository.
- ///
- ///
- /// See the API documentation for more details
- ///
- /// The Id of the repository
- /// Options for changing the API response
- /// Thrown when a general API error occurs.
- /// All es of the repository
- [Obsolete("Please use ObservableRepositoriesClient.Branch.GetAll() instead. This method will be removed in a future version")]
- IObservable GetAllBranches(long repositoryId, ApiOptions options);
-
///
/// Gets all contributors for the specified repository. Does not include anonymous contributors.
///
@@ -474,31 +422,6 @@ public interface IObservableRepositoriesClient
/// All of the repositories tags.
IObservable GetAllTags(long repositoryId, ApiOptions options);
- ///
- /// Gets the specified branch.
- ///
- ///
- /// See the API documentation for more details
- ///
- /// The owner of the repository
- /// The name of the repository
- /// The name of the branch
- /// The specified
- [Obsolete("Please use ObservableRepositoriesClient.Branch.Get() instead. This method will be removed in a future version")]
- IObservable GetBranch(string owner, string name, string branchName);
-
- ///
- /// Gets the specified branch.
- ///
- ///
- /// See the API documentation for more details
- ///
- /// The Id of the repository
- /// The name of the branch
- /// The specified
- [Obsolete("Please use ObservableRepositoriesClient.Branch.Get() instead. This method will be removed in a future version")]
- IObservable GetBranch(long repositoryId, string branchName);
-
///
/// Updates the specified repository with the values given in
///
diff --git a/Octokit.Reactive/Clients/ObservableRepositoriesClient.cs b/Octokit.Reactive/Clients/ObservableRepositoriesClient.cs
index ef51d0fb44..54b07b63d9 100644
--- a/Octokit.Reactive/Clients/ObservableRepositoriesClient.cs
+++ b/Octokit.Reactive/Clients/ObservableRepositoriesClient.cs
@@ -322,79 +322,6 @@ public IObservable GetAllForOrg(string organization, ApiOptions opti
///
public IObservableMergingClient Merging { get; private set; }
- ///
- /// Gets all the branches for the specified repository.
- ///
- ///
- /// See the API documentation for more details
- ///
- /// The owner of the repository
- /// The name of the repository
- /// Thrown when a general API error occurs.
- /// All es of the repository
- [Obsolete("Please use ObservableRepositoriesClient.Branch.GetAll() instead. This method will be removed in a future version")]
- public IObservable GetAllBranches(string owner, string name)
- {
- Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
- Ensure.ArgumentNotNullOrEmptyString(name, "name");
-
- return Branch.GetAll(owner, name, ApiOptions.None);
- }
-
- ///
- /// Gets all the branches for the specified repository.
- ///
- ///
- /// See the API documentation for more details
- ///
- /// The Id of the repository
- /// Thrown when a general API error occurs.
- /// All es of the repository
- [Obsolete("Please use ObservableRepositoriesClient.Branch.GetAll() instead. This method will be removed in a future version")]
- public IObservable GetAllBranches(long repositoryId)
- {
- return Branch.GetAll(repositoryId, ApiOptions.None);
- }
-
- ///
- /// Gets all the branches for the specified repository.
- ///
- ///
- /// See the API documentation for more details
- ///
- /// The owner of the repository
- /// The name of the repository
- /// Options for changing the API response
- /// Thrown when a general API error occurs.
- /// All es of the repository
- [Obsolete("Please use ObservableRepositoriesClient.Branch.GetAll() instead. This method will be removed in a future version")]
- public IObservable GetAllBranches(string owner, string name, ApiOptions options)
- {
- Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
- Ensure.ArgumentNotNullOrEmptyString(name, "name");
- Ensure.ArgumentNotNull(options, "options");
-
- return Branch.GetAll(owner, name, options);
- }
-
- ///
- /// Gets all the branches for the specified repository.
- ///
- ///
- /// See the API documentation for more details
- ///
- /// The Id of the repository
- /// Options for changing the API response
- /// Thrown when a general API error occurs.
- /// All es of the repository
- [Obsolete("Please use ObservableRepositoriesClient.Branch.GetAll() instead. This method will be removed in a future version")]
- public IObservable GetAllBranches(long repositoryId, ApiOptions options)
- {
- Ensure.ArgumentNotNull(options, "options");
-
- return Branch.GetAll(repositoryId, options);
- }
-
///
/// Gets all contributors for the specified repository. Does not include anonymous contributors.
///
@@ -705,43 +632,6 @@ public IObservable GetAllTags(long repositoryId, ApiOptions optio
return _connection.GetAndFlattenAllPages(ApiUrls.RepositoryTags(repositoryId), options);
}
- ///
- /// Gets the specified branch.
- ///
- ///
- /// See the API documentation for more details
- ///
- /// The owner of the repository
- /// The name of the repository
- /// The name of the branch
- /// The specified
- [Obsolete("Please use ObservableRepositoriesClient.Branch.Get() instead. This method will be removed in a future version")]
- public IObservable GetBranch(string owner, string name, string branchName)
- {
- Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
- Ensure.ArgumentNotNullOrEmptyString(name, "name");
- Ensure.ArgumentNotNullOrEmptyString(branchName, "branchName");
-
- return Branch.Get(owner, name, branchName);
- }
-
- ///
- /// Gets the specified branch.
- ///
- ///
- /// See the API documentation for more details
- ///
- /// The Id of the repository
- /// The name of the branch
- /// The specified
- [Obsolete("Please use ObservableRepositoriesClient.Branch.Get() instead. This method will be removed in a future version")]
- public IObservable GetBranch(long repositoryId, string branchName)
- {
- Ensure.ArgumentNotNullOrEmptyString(branchName, "branchName");
-
- return Branch.Get(repositoryId, branchName);
- }
-
///
/// Updates the specified repository with the values given in
///
diff --git a/Octokit.Tests.Integration/Clients/PullRequestsClientTests.cs b/Octokit.Tests.Integration/Clients/PullRequestsClientTests.cs
index 80afe81b67..ec1b56122c 100644
--- a/Octokit.Tests.Integration/Clients/PullRequestsClientTests.cs
+++ b/Octokit.Tests.Integration/Clients/PullRequestsClientTests.cs
@@ -668,22 +668,6 @@ public async Task CanBeMergedWithShaSpecified()
Assert.True(result.Merged);
}
- [IntegrationTest]
- public async Task CanBeMergedWithSquashCommit()
- {
- await CreateTheWorld();
-
- var newPullRequest = new NewPullRequest("squash commit pull request", branchName, "master");
- var pullRequest = await _fixture.Create(Helper.UserName, _context.RepositoryName, newPullRequest);
-
- var merge = new MergePullRequest { CommitMessage = "fake commit message", CommitTitle = "fake title", Squash = true };
- var result = await _fixture.Merge(Helper.UserName, _context.RepositoryName, pullRequest.Number, merge);
- var commit = await _github.Repository.Commit.Get(_context.RepositoryOwner, _context.RepositoryName, result.Sha);
-
- Assert.True(result.Merged);
- Assert.Equal("fake title\n\nfake commit message", commit.Commit.Message);
- }
-
[IntegrationTest]
public async Task CanBeMergedWithMergeMethod()
{
diff --git a/Octokit.Tests.Integration/Clients/RepositoriesClientTests.cs b/Octokit.Tests.Integration/Clients/RepositoriesClientTests.cs
index 4cad33fda5..8b40dafa3a 100644
--- a/Octokit.Tests.Integration/Clients/RepositoriesClientTests.cs
+++ b/Octokit.Tests.Integration/Clients/RepositoriesClientTests.cs
@@ -1458,186 +1458,6 @@ public async Task GetsPagesOfTagsWithRepositoryId()
}
}
- public class TheGetAllBranchesMethod
- {
- [IntegrationTest]
- public async Task GetsAllBranches()
- {
- var github = Helper.GetAuthenticatedClient();
-
- var branches = await github.Repository.GetAllBranches("octokit", "octokit.net");
-
- Assert.NotEmpty(branches);
- }
-
- [IntegrationTest]
- public async Task GetsAllBranchesWithRepositoryId()
- {
- var github = Helper.GetAuthenticatedClient();
-
- var branches = await github.Repository.GetAllBranches(7528679);
-
- Assert.NotEmpty(branches);
- }
-
- [IntegrationTest]
- public async Task ReturnsCorrectCountOfBranchesWithoutStart()
- {
- var github = Helper.GetAuthenticatedClient();
-
- var options = new ApiOptions
- {
- PageSize = 5,
- PageCount = 1
- };
-
- var branches = await github.Repository.GetAllBranches("octokit", "octokit.net", options);
-
- Assert.Equal(5, branches.Count);
- }
-
- [IntegrationTest]
- public async Task ReturnsCorrectCountOfBranchesWithoutStartWithRepositoryId()
- {
- var github = Helper.GetAuthenticatedClient();
-
- var options = new ApiOptions
- {
- PageSize = 5,
- PageCount = 1
- };
-
- var branches = await github.Repository.GetAllBranches(7528679, options);
-
- Assert.Equal(5, branches.Count);
- }
-
- [IntegrationTest]
- public async Task ReturnsCorrectCountOfBranchesWithStart()
- {
- var github = Helper.GetAuthenticatedClient();
-
- var options = new ApiOptions
- {
- PageSize = 5,
- PageCount = 1,
- StartPage = 2
- };
-
- var branches = await github.Repository.GetAllBranches("octokit", "octokit.net", options);
-
- Assert.Equal(5, branches.Count);
- }
-
- [IntegrationTest]
- public async Task ReturnsCorrectCountOfBranchesWithStartWithRepositoryId()
- {
- var github = Helper.GetAuthenticatedClient();
-
- var options = new ApiOptions
- {
- PageSize = 5,
- PageCount = 1,
- StartPage = 2
- };
-
- var branches = await github.Repository.GetAllBranches(7528679, options);
-
- Assert.Equal(5, branches.Count);
- }
-
- [IntegrationTest]
- public async Task GetsPagesOfBranches()
- {
- var github = Helper.GetAuthenticatedClient();
-
- var firstPageOptions = new ApiOptions
- {
- PageSize = 5,
- StartPage = 1,
- PageCount = 1
- };
-
- var firstPage = await github.Repository.GetAllBranches("octokit", "octokit.net", firstPageOptions);
-
- var secondPageOptions = new ApiOptions
- {
- PageSize = 5,
- StartPage = 2,
- PageCount = 1
- };
-
- var secondPage = await github.Repository.GetAllBranches("octokit", "octokit.net", secondPageOptions);
-
- Assert.Equal(5, firstPage.Count);
- Assert.Equal(5, secondPage.Count);
-
- Assert.NotEqual(firstPage[0].Name, secondPage[0].Name);
- Assert.NotEqual(firstPage[1].Name, secondPage[1].Name);
- Assert.NotEqual(firstPage[2].Name, secondPage[2].Name);
- Assert.NotEqual(firstPage[3].Name, secondPage[3].Name);
- Assert.NotEqual(firstPage[4].Name, secondPage[4].Name);
- }
-
- [IntegrationTest]
- public async Task GetsPagesOfBranchesWithRepositoryId()
- {
- var github = Helper.GetAuthenticatedClient();
-
- var firstPageOptions = new ApiOptions
- {
- PageSize = 5,
- StartPage = 1,
- PageCount = 1
- };
-
- var firstPage = await github.Repository.GetAllBranches(7528679, firstPageOptions);
-
- var secondPageOptions = new ApiOptions
- {
- PageSize = 5,
- StartPage = 2,
- PageCount = 1
- };
-
- var secondPage = await github.Repository.GetAllBranches(7528679, secondPageOptions);
-
- Assert.Equal(5, firstPage.Count);
- Assert.Equal(5, secondPage.Count);
-
- Assert.NotEqual(firstPage[0].Name, secondPage[0].Name);
- Assert.NotEqual(firstPage[1].Name, secondPage[1].Name);
- Assert.NotEqual(firstPage[2].Name, secondPage[2].Name);
- Assert.NotEqual(firstPage[3].Name, secondPage[3].Name);
- Assert.NotEqual(firstPage[4].Name, secondPage[4].Name);
- }
- }
-
- public class TheGetBranchMethod
- {
- [IntegrationTest]
- public async Task GetsABranch()
- {
- var github = Helper.GetAuthenticatedClient();
-
- var branch = await github.Repository.GetBranch("octokit", "octokit.net", "master");
-
- Assert.NotNull(branch);
- Assert.Equal("master", branch.Name);
- }
-
- [IntegrationTest]
- public async Task GetsABranchWithRepositoryId()
- {
- var github = Helper.GetAuthenticatedClient();
-
- var branch = await github.Repository.GetBranch(7528679, "master");
-
- Assert.NotNull(branch);
- Assert.Equal("master", branch.Name);
- }
- }
-
public class TheGetAllTeamsMethod
{
[IntegrationTest(Skip = "Test requires administration rights to access this endpoint")]
diff --git a/Octokit.Tests.Integration/Helpers/ReferenceExtensionsTests.cs b/Octokit.Tests.Integration/Helpers/ReferenceExtensionsTests.cs
index 6a47e8bb20..cba1997717 100644
--- a/Octokit.Tests.Integration/Helpers/ReferenceExtensionsTests.cs
+++ b/Octokit.Tests.Integration/Helpers/ReferenceExtensionsTests.cs
@@ -1,8 +1,5 @@
using Octokit.Helpers;
-using System;
-using System.Collections.Generic;
using System.Linq;
-using System.Text;
using System.Threading.Tasks;
using Xunit;
@@ -22,7 +19,7 @@ public async Task CreateABranch()
var branchFromPath = await fixture.CreateBranch(context.RepositoryOwner, context.RepositoryName, "patch-2", branchFromMaster);
- var allBranchNames = (await client.Repository.GetAllBranches(context.RepositoryOwner, context.RepositoryName)).Select(b => b.Name);
+ var allBranchNames = (await client.Repository.Branch.GetAll(context.RepositoryOwner, context.RepositoryName)).Select(b => b.Name);
Assert.Contains("patch-1", allBranchNames);
Assert.Contains("patch-2", allBranchNames);
diff --git a/Octokit.Tests/Clients/RepositoriesClientTests.cs b/Octokit.Tests/Clients/RepositoriesClientTests.cs
index 12fcbb09d6..21acc3886f 100644
--- a/Octokit.Tests/Clients/RepositoriesClientTests.cs
+++ b/Octokit.Tests/Clients/RepositoriesClientTests.cs
@@ -513,91 +513,6 @@ public async Task EnsuresNonNullArguments()
}
}
- public class TheGetAllBranchesMethod
- {
- [Fact]
- public async Task RequestsTheCorrectUrl()
- {
- var connection = Substitute.For();
- var client = new RepositoriesClient(connection);
-
- await client.GetAllBranches("owner", "name");
-
- connection.Received()
- .GetAll(Arg.Is(u => u.ToString() == "repos/owner/name/branches"), null, "application/vnd.github.loki-preview+json", Args.ApiOptions);
- }
-
- [Fact]
- public async Task RequestsTheCorrectUrlWithRepositoryId()
- {
- var connection = Substitute.For();
- var client = new RepositoriesClient(connection);
-
- await client.GetAllBranches(1);
-
- connection.Received()
- .GetAll(Arg.Is(u => u.ToString() == "repositories/1/branches"), null, "application/vnd.github.loki-preview+json", Args.ApiOptions);
- }
-
- [Fact]
- public async Task RequestsTheCorrectUrlWithApiOptions()
- {
- var connection = Substitute.For();
- var client = new RepositoriesClient(connection);
-
- var options = new ApiOptions
- {
- PageCount = 1,
- StartPage = 1,
- PageSize = 1
- };
-
- await client.GetAllBranches("owner", "name", options);
-
- connection.Received()
- .GetAll(Arg.Is(u => u.ToString() == "repos/owner/name/branches"), null, "application/vnd.github.loki-preview+json", options);
- }
-
- [Fact]
- public async Task RequestsTheCorrectUrlWithRepositoryIdWithApiOptions()
- {
- var connection = Substitute.For();
- var client = new RepositoriesClient(connection);
-
- var options = new ApiOptions
- {
- PageCount = 1,
- StartPage = 1,
- PageSize = 1
- };
-
- await client.GetAllBranches(1, options);
-
- connection.Received()
- .GetAll(Arg.Is(u => u.ToString() == "repositories/1/branches"), null, "application/vnd.github.loki-preview+json", options);
- }
-
- [Fact]
- public async Task EnsuresNonNullArguments()
- {
- var client = new RepositoriesClient(Substitute.For());
-
- await Assert.ThrowsAsync(() => client.GetAllBranches(null, "name"));
- await Assert.ThrowsAsync(() => client.GetAllBranches("owner", null));
-
- await Assert.ThrowsAsync(() => client.GetAllBranches(null, "name", ApiOptions.None));
- await Assert.ThrowsAsync(() => client.GetAllBranches("owner", null, ApiOptions.None));
- await Assert.ThrowsAsync(() => client.GetAllBranches("owner", "name", null));
-
- await Assert.ThrowsAsync(() => client.GetAllBranches(1, null));
-
- await Assert.ThrowsAsync(() => client.GetAllBranches("", "name"));
- await Assert.ThrowsAsync(() => client.GetAllBranches("owner", ""));
- await Assert.ThrowsAsync(() => client.GetAllBranches("", "name", ApiOptions.None));
- await Assert.ThrowsAsync(() => client.GetAllBranches("owner", "", ApiOptions.None));
- }
- }
-
public class TheGetAllContributorsMethod
{
[Fact]
@@ -965,49 +880,6 @@ public async Task EnsuresNonNullArguments()
}
}
- public class TheGetBranchMethod
- {
- [Fact]
- public async Task RequestsTheCorrectUrl()
- {
- var connection = Substitute.For();
- var client = new RepositoriesClient(connection);
-
- await client.GetBranch("owner", "repo", "branch");
-
- connection.Received()
- .Get(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch"), null, "application/vnd.github.loki-preview+json");
- }
-
- [Fact]
- public async Task RequestsTheCorrectUrlWithRepositoryId()
- {
- var connection = Substitute.For();
- var client = new RepositoriesClient(connection);
-
- await client.GetBranch(1, "branch");
-
- connection.Received()
- .Get(Arg.Is(u => u.ToString() == "repositories/1/branches/branch"), null, "application/vnd.github.loki-preview+json");
- }
-
- [Fact]
- public async Task EnsuresNonNullArguments()
- {
- var client = new RepositoriesClient(Substitute.For());
-
- await Assert.ThrowsAsync(() => client.GetBranch(null, "repo", "branch"));
- await Assert.ThrowsAsync(() => client.GetBranch("owner", null, "branch"));
- await Assert.ThrowsAsync(() => client.GetBranch("owner", "repo", null));
-
- await Assert.ThrowsAsync(() => client.GetBranch(1, null));
-
- await Assert.ThrowsAsync(() => client.GetBranch("", "repo", "branch"));
- await Assert.ThrowsAsync(() => client.GetBranch("owner", "", "branch"));
- await Assert.ThrowsAsync(() => client.GetBranch("owner", "repo", ""));
- }
- }
-
public class TheEditMethod
{
[Fact]
diff --git a/Octokit.Tests/Reactive/ObservableRepositoriesClientTests.cs b/Octokit.Tests/Reactive/ObservableRepositoriesClientTests.cs
index 565b4ba563..b76429fac8 100644
--- a/Octokit.Tests/Reactive/ObservableRepositoriesClientTests.cs
+++ b/Octokit.Tests/Reactive/ObservableRepositoriesClientTests.cs
@@ -320,91 +320,6 @@ public async Task ReturnsEveryPageOfRepositories()
}
}
- public class TheGetAllBranchesMethod
- {
- [Fact]
- public void RequestsTheCorrectUrl()
- {
- var gitHubClient = Substitute.For();
- var client = new ObservableRepositoriesClient(gitHubClient);
- var expected = new Uri("repos/owner/repo/branches", UriKind.Relative);
-
- client.GetAllBranches("owner", "repo");
-
- gitHubClient.Connection.Received(1).Get>(expected, Args.EmptyDictionary, null);
- }
-
- [Fact]
- public void RequestsTheCorrectUrlWithRepositoryId()
- {
- var gitHubClient = Substitute.For();
- var client = new ObservableRepositoriesClient(gitHubClient);
- var expected = new Uri("repositories/1/branches", UriKind.Relative);
-
- client.GetAllBranches(1);
-
- gitHubClient.Connection.Received(1).Get>(expected, Args.EmptyDictionary, null);
- }
-
- [Fact]
- public void RequestsTheCorrectUrlWithApiOptions()
- {
- var gitHubClient = Substitute.For();
- var client = new ObservableRepositoriesClient(gitHubClient);
- var expected = new Uri("repos/owner/name/branches", UriKind.Relative);
-
- var options = new ApiOptions
- {
- PageCount = 1,
- StartPage = 1,
- PageSize = 1
- };
-
- client.GetAllBranches("owner", "name", options);
-
- gitHubClient.Connection.Received(1).Get>(expected, Arg.Is>(d => d.Count == 2 && d["page"] == "1" && d["per_page"] == "1"), null);
- }
-
- [Fact]
- public void RequestsTheCorrectUrlWithRepositoryIdWithApiOptions()
- {
- var gitHubClient = Substitute.For();
- var client = new ObservableRepositoriesClient(gitHubClient);
- var expected = new Uri("repositories/1/branches", UriKind.Relative);
-
- var options = new ApiOptions
- {
- PageCount = 1,
- StartPage = 1,
- PageSize = 1
- };
-
- client.GetAllBranches(1, options);
-
- gitHubClient.Connection.Received(1).Get>(expected, Arg.Is>(d => d.Count == 2 && d["page"] == "1" && d["per_page"] == "1"), null);
- }
-
- [Fact]
- public void EnsuresNonNullArguments()
- {
- var client = new ObservableRepositoriesClient(Substitute.For());
-
- Assert.Throws(() => client.GetAllBranches(null, "name"));
- Assert.Throws(() => client.GetAllBranches("owner", null));
-
- Assert.Throws(() => client.GetAllBranches(null, "name", ApiOptions.None));
- Assert.Throws(() => client.GetAllBranches("owner", null, ApiOptions.None));
- Assert.Throws(() => client.GetAllBranches("owner", "name", null));
-
- Assert.Throws(() => client.GetAllBranches(1, null));
-
- Assert.Throws(() => client.GetAllBranches("", "name"));
- Assert.Throws(() => client.GetAllBranches("owner", ""));
- Assert.Throws(() => client.GetAllBranches("", "name", ApiOptions.None));
- Assert.Throws(() => client.GetAllBranches("owner", "", ApiOptions.None));
- }
- }
-
public class TheGetCommitMethod
{
[Fact]
@@ -838,49 +753,6 @@ public void EnsuresNonNullArguments()
}
}
- public class TheGetBranchMethod
- {
- [Fact]
- public void RequestsTheCorrectUrl()
- {
- var github = Substitute.For();
- var client = new ObservableRepositoriesClient(github);
-
- client.GetBranch("owner", "repo", "branch");
-
- github.Repository.Branch.Received(1).Get("owner", "repo", "branch");
- }
-
- [Fact]
- public void RequestsTheCorrectUrlWithRepositoryId()
- {
- var github = Substitute.For();
- var client = new ObservableRepositoriesClient(github);
-
- client.GetBranch(1, "branch");
-
- github.Repository.Branch.Received(1).Get(1, "branch");
- }
-
- [Fact]
- public async Task EnsuresNonNullArguments()
- {
- var client = new ObservableRepositoriesClient(Substitute.For());
-
- Assert.Throws(() => client.GetBranch(null, "repo", "branch"));
- Assert.Throws(() => client.GetBranch("owner", null, "branch"));
- Assert.Throws(() => client.GetBranch("owner", "repo", null));
-
- Assert.Throws(() => client.GetBranch(1, null));
-
- Assert.Throws(() => client.GetBranch("", "repo", "branch"));
- Assert.Throws(() => client.GetBranch("owner", "", "branch"));
- Assert.Throws(() => client.GetBranch("owner", "repo", ""));
-
- Assert.Throws(() => client.GetBranch(1, ""));
- }
- }
-
public class TheEditMethod
{
[Fact]
diff --git a/Octokit/Clients/IRepositoriesClient.cs b/Octokit/Clients/IRepositoriesClient.cs
index 65a43d264f..a27e31a67a 100644
--- a/Octokit/Clients/IRepositoriesClient.cs
+++ b/Octokit/Clients/IRepositoriesClient.cs
@@ -322,58 +322,6 @@ public interface IRepositoriesClient
///
IMergingClient Merging { get; }
- ///
- /// Gets all the branches for the specified repository.
- ///
- ///
- /// See the API documentation for more details
- ///
- /// The owner of the repository
- /// The name of the repository
- /// Thrown when a general API error occurs.
- /// All es of the repository
- [Obsolete("Please use RepositoriesClient.Branch.GetAll() instead. This method will be removed in a future version")]
- Task> GetAllBranches(string owner, string name);
-
- ///
- /// Gets all the branches for the specified repository.
- ///
- ///
- /// See the API documentation for more details
- ///
- /// The Id of the repository
- /// Thrown when a general API error occurs.
- /// All es of the repository
- [Obsolete("Please use RepositoriesClient.Branch.GetAll() instead. This method will be removed in a future version")]
- Task> GetAllBranches(long repositoryId);
-
- ///
- /// Gets all the branches for the specified repository.
- ///
- ///
- /// See the API documentation for more details
- ///
- /// The owner of the repository
- /// The name of the repository
- /// Options for changing the API response
- /// Thrown when a general API error occurs.
- /// All es of the repository
- [Obsolete("Please use RepositoriesClient.Branch.GetAll() instead. This method will be removed in a future version")]
- Task> GetAllBranches(string owner, string name, ApiOptions options);
-
- ///
- /// Gets all the branches for the specified repository.
- ///
- ///
- /// See the API documentation for more details
- ///
- /// The Id of the repository
- /// Options for changing the API response
- /// Thrown when a general API error occurs.
- /// All es of the repository
- [Obsolete("Please use RepositoriesClient.Branch.GetAll() instead. This method will be removed in a future version")]
- Task> GetAllBranches(long repositoryId, ApiOptions options);
-
///
/// Gets all contributors for the specified repository. Does not include anonymous contributors.
///
@@ -575,31 +523,6 @@ public interface IRepositoriesClient
/// All of the repositories tags.
Task> GetAllTags(long repositoryId, ApiOptions options);
- ///
- /// Gets the specified branch.
- ///
- ///
- /// See the API documentation for more details
- ///
- /// The owner of the repository
- /// The name of the repository
- /// The name of the branch
- /// The specified
- [Obsolete("Please use RepositoriesClient.Branch.Get() instead. This method will be removed in a future version")]
- Task GetBranch(string owner, string name, string branchName);
-
- ///
- /// Gets the specified branch.
- ///
- ///
- /// See the API documentation for more details
- ///
- /// The Id of the repository
- /// The name of the branch
- /// The specified
- [Obsolete("Please use RepositoriesClient.Branch.Get() instead. This method will be removed in a future version")]
- Task GetBranch(long repositoryId, string branchName);
-
///
/// Updates the specified repository with the values given in
///
diff --git a/Octokit/Clients/RepositoriesClient.cs b/Octokit/Clients/RepositoriesClient.cs
index 4c8564d6fa..0b8fd00a60 100644
--- a/Octokit/Clients/RepositoriesClient.cs
+++ b/Octokit/Clients/RepositoriesClient.cs
@@ -162,22 +162,6 @@ public Task Delete(long repositoryId)
return ApiConnection.Delete(ApiUrls.Repository(repositoryId));
}
- ///
- /// Gets the specified branch.
- ///
- ///
- /// See the API documentation for more details
- ///
- /// The Id of the repository
- /// The name of the branch
- [Obsolete("Please use RepositoriesClient.Branch.Get() instead. This method will be removed in a future version")]
- public Task GetBranch(long repositoryId, string branchName)
- {
- Ensure.ArgumentNotNullOrEmptyString(branchName, "branchName");
-
- return Branch.Get(repositoryId, branchName);
- }
-
///
/// Updates the specified repository with the values given in
///
@@ -513,71 +497,6 @@ public Task> GetAllForOrg(string organization, ApiOpti
///
public IRepositoryContentsClient Content { get; private set; }
- ///
- /// Gets all the branches for the specified repository.
- ///
- ///
- /// See the API documentation for more details
- ///
- /// The owner of the repository
- /// The name of the repository
- [Obsolete("Please use RepositoriesClient.Branch.GetAll() instead. This method will be removed in a future version")]
- public Task> GetAllBranches(string owner, string name)
- {
- Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
- Ensure.ArgumentNotNullOrEmptyString(name, "name");
-
- return Branch.GetAll(owner, name);
- }
-
- ///
- /// Gets all the branches for the specified repository.
- ///
- ///
- /// See the API documentation for more details
- ///
- /// The Id of the repository
- [Obsolete("Please use RepositoriesClient.Branch.GetAll() instead. This method will be removed in a future version")]
- public Task> GetAllBranches(long repositoryId)
- {
- return Branch.GetAll(repositoryId);
- }
-
- ///
- /// Gets all the branches for the specified repository.
- ///
- ///
- /// See the API documentation for more details
- ///
- /// The owner of the repository
- /// The name of the repository
- /// Options for changing the API response
- [Obsolete("Please use RepositoriesClient.Branch.GetAll() instead. This method will be removed in a future version")]
- public Task> GetAllBranches(string owner, string name, ApiOptions options)
- {
- Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
- Ensure.ArgumentNotNullOrEmptyString(name, "name");
- Ensure.ArgumentNotNull(options, "options");
-
- return Branch.GetAll(owner, name, options);
- }
-
- ///
- /// Gets all the branches for the specified repository.
- ///
- ///
- /// See the API documentation for more details
- ///
- /// The Id of the repository
- /// Options for changing the API response
- [Obsolete("Please use RepositoriesClient.Branch.GetAll() instead. This method will be removed in a future version")]
- public Task> GetAllBranches(long repositoryId, ApiOptions options)
- {
- Ensure.ArgumentNotNull(options, "options");
-
- return Branch.GetAll(repositoryId, options);
- }
-
///
/// Gets all contributors for the specified repository. Does not include anonymous contributors.
///
@@ -888,25 +807,6 @@ public Task> GetAllTags(long repositoryId, ApiOptio
return ApiConnection.GetAll(ApiUrls.RepositoryTags(repositoryId), options);
}
- ///
- /// Gets the specified branch.
- ///
- ///
- /// See the API documentation for more details
- ///
- /// The owner of the repository
- /// The name of the repository
- /// The name of the branch
- [Obsolete("Please use RepositoriesClient.Branch.Get() instead. This method will be removed in a future version")]
- public Task GetBranch(string owner, string name, string branchName)
- {
- Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
- Ensure.ArgumentNotNullOrEmptyString(name, "name");
- Ensure.ArgumentNotNullOrEmptyString(branchName, "branchName");
-
- return Branch.Get(owner, name, branchName);
- }
-
///
/// A client for GitHub's Repository Pages API.
///
diff --git a/Octokit/Models/Request/MergePullRequest.cs b/Octokit/Models/Request/MergePullRequest.cs
index 91bc8a3411..061ca593f4 100644
--- a/Octokit/Models/Request/MergePullRequest.cs
+++ b/Octokit/Models/Request/MergePullRequest.cs
@@ -29,12 +29,6 @@ public class MergePullRequest
///
public string CommitTitle { get; set; }
- ///
- /// Commit a single commit to the head branch (optional)
- ///
- [Obsolete("Please use MergeMethod property. This property will no longer be supported by the GitHub API and will be removed in a future version")]
- public bool Squash { get; set; }
-
///
/// Specify the Merge method to use (optional - default is Merge)
///
diff --git a/Octokit/Models/Request/NewDeploymentStatus.cs b/Octokit/Models/Request/NewDeploymentStatus.cs
index 9054c9398c..5a4da78973 100644
--- a/Octokit/Models/Request/NewDeploymentStatus.cs
+++ b/Octokit/Models/Request/NewDeploymentStatus.cs
@@ -24,14 +24,6 @@ public NewDeploymentStatus(DeploymentState deploymentState)
///
public DeploymentState State { get; private set; }
- ///
- /// The target URL to associate with this status. This URL should contain
- /// output to keep the user updated while the task is running or serve as
- /// historical information for what happened in the deployment
- ///
- [Obsolete("This property is obsolete. Use LogUrl instead.", false)]
- public string TargetUrl { get; set; }
-
///
/// The target URL to associate with this status. This URL should contain
/// output to keep the user updated while the task is running or serve as
diff --git a/Octokit/Models/Request/PublicRepositoryRequest.cs b/Octokit/Models/Request/PublicRepositoryRequest.cs
index 17a95bede5..321d519ed9 100644
--- a/Octokit/Models/Request/PublicRepositoryRequest.cs
+++ b/Octokit/Models/Request/PublicRepositoryRequest.cs
@@ -10,18 +10,6 @@ namespace Octokit
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class PublicRepositoryRequest : RequestParameters
{
- ///
- /// Initializes a new instance of the class.
- ///
- /// The integer Id of the last Repository that you’ve seen.
- [Obsolete("Please use the alternative constructor taking a long, rather than int, typed parameter. This constructor will be removed in a future release.")]
- public PublicRepositoryRequest(int since)
- {
- Ensure.ArgumentNotNull(since, "since");
-
- Since = since;
- }
-
///
/// Initializes a new instance of the class.
///