diff --git a/GitTfs/Core/GitRepository.cs b/GitTfs/Core/GitRepository.cs index 1f804065..5b83b9f6 100644 --- a/GitTfs/Core/GitRepository.cs +++ b/GitTfs/Core/GitRepository.cs @@ -408,10 +408,9 @@ namespace Sep.Git.Tfs.Core public string AssertValidBranchName(string gitBranchName) { - var newGitBranchName = CommandOneline("check-ref-format", "--branch", gitBranchName); - if (string.IsNullOrWhiteSpace(newGitBranchName) || newGitBranchName.IndexOf("fatal:") == 0) + if (!_repository.Refs.IsValidName("refs/heads/" + gitBranchName)) throw new GitTfsException("The name specified for the new git branch is not allowed. Choose another one!"); - return newGitBranchName.Trim(); + return gitBranchName; } public bool CreateBranch(string gitBranchName, string target) diff --git a/lib/libgit2sharp b/lib/libgit2sharp index c1743ba7..247ca1a3 160000 --- a/lib/libgit2sharp +++ b/lib/libgit2sharp @@ -1 +1 @@ -Subproject commit c1743ba7f9547f53d565222f628fbc7138a65973 +Subproject commit 247ca1a30cfb722b74ada4288bcca7293f59b87b