From 3bf9fa4fb50fcaa5a2c0f951efca3a3f0c052199 Mon Sep 17 00:00:00 2001 From: Philippe Miossec Date: Fri, 16 Nov 2012 18:16:49 +0100 Subject: [PATCH] init-branch : Update libgit2sharp to use IsValidName() --- GitTfs/Core/GitRepository.cs | 5 ++--- lib/libgit2sharp | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) 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