diff --git a/LibGit2Sharp.Tests/RemoteFixture.cs b/LibGit2Sharp.Tests/RemoteFixture.cs index ebe67591d..e684b2a25 100644 --- a/LibGit2Sharp.Tests/RemoteFixture.cs +++ b/LibGit2Sharp.Tests/RemoteFixture.cs @@ -153,7 +153,7 @@ public void CanTellIfARemoteNameIsValid(string refname, bool expectedResult) { using (var repo = new Repository(BareTestRepoPath)) { - Assert.Equal(expectedResult, repo.Network.Remotes.IsValidName(refname)); + Assert.Equal(expectedResult, Remote.IsValidName(refname)); } } diff --git a/LibGit2Sharp/Remote.cs b/LibGit2Sharp/Remote.cs index 4524e77aa..d86e44ebc 100644 --- a/LibGit2Sharp/Remote.cs +++ b/LibGit2Sharp/Remote.cs @@ -95,6 +95,16 @@ internal string FetchSpecTransformToSource(string reference) } } + /// + /// Determines if the proposed remote name is well-formed. + /// + /// The name to be checked. + /// true is the name is valid; false otherwise. + public static bool IsValidName(string name) + { + return Proxy.git_remote_is_valid_name(name); + } + /// /// Determines whether the specified is equal to the current . /// diff --git a/LibGit2Sharp/RemoteCollection.cs b/LibGit2Sharp/RemoteCollection.cs index ca58c51d7..bd031eeba 100644 --- a/LibGit2Sharp/RemoteCollection.cs +++ b/LibGit2Sharp/RemoteCollection.cs @@ -131,9 +131,10 @@ public virtual Remote Add(string name, string url, string fetchRefSpec) /// /// The name to be checked. /// true is the name is valid; false otherwise. + [Obsolete("This method will be removed in the next release. Please use Remote.IsValidName(string) instead.")] public virtual bool IsValidName(string name) { - return Proxy.git_remote_is_valid_name(name); + return Remote.IsValidName(name); } private string DebuggerDisplay