From 3e7ae3113e27d0aab7bf54186263ae6be0ff3d25 Mon Sep 17 00:00:00 2001 From: Jameson Miller Date: Mon, 3 Nov 2014 13:22:46 -0500 Subject: [PATCH] Ensure one can create a branch in a deleted nested branch namespace --- LibGit2Sharp.Tests/BranchFixture.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/LibGit2Sharp.Tests/BranchFixture.cs b/LibGit2Sharp.Tests/BranchFixture.cs index 8c29534f0..88b6ec878 100644 --- a/LibGit2Sharp.Tests/BranchFixture.cs +++ b/LibGit2Sharp.Tests/BranchFixture.cs @@ -919,6 +919,24 @@ public void CanRemoveAnExistingBranch(string branchName) } } + [Fact] + public void CanCreateBranchInDeletedNestedBranchNamespace() + { + const string namespaceName = "level_one"; + string branchWithNamespaceName = string.Join("/", namespaceName, "level_two"); + + string path = SandboxStandardTestRepo(); + using (var repo = new Repository(path)) + { + Commit commit = repo.Head.Tip; + + Branch branchWithNamespace = repo.Branches.Add(branchWithNamespaceName, commit); + repo.Branches.Remove(branchWithNamespace); + + repo.Branches.Add(namespaceName, commit); + } + } + [Theory] [InlineData("I-donot-exist", false)] [InlineData("me/neither", true)]