diff --git a/GitTfsTest/Integration/CloneTests.cs b/GitTfsTest/Integration/CloneTests.cs index 503c5c7a4..bec5aecf8 100644 --- a/GitTfsTest/Integration/CloneTests.cs +++ b/GitTfsTest/Integration/CloneTests.cs @@ -125,5 +125,24 @@ private void AssertRefs(string expectedSha) h.AssertRef("MyProject", "master", expectedSha); h.AssertRef("MyProject", "tfs/default", expectedSha); } + + [TestMethod] + public void CloneWithtMixedUpCase() + { + h.SetupFake(r => + { + r.Changeset(1, "Project created from template", DateTime.Parse("2012-01-01 12:12:12")) + .Change(TfsChangeType.Add, TfsItemType.Folder, "$/MyProject"); + r.Changeset(2, "First commit", DateTime.Parse("2012-01-02 12:12:12")) + .Change(TfsChangeType.Add, TfsItemType.Folder, "$/MyProject/Folder") + .Change(TfsChangeType.Add, TfsItemType.File, "$/MyProject/Folder/File.txt", "File contents") + .Change(TfsChangeType.Add, TfsItemType.File, "$/MyProject/README", "tldr"); + r.Changeset(2, "Second commit", DateTime.Parse("2012-01-02 12:12:12")) + .Change(TfsChangeType.Add, TfsItemType.File, "$/myproject/folder/file2.txt", "File contents in lowercase path"); + }); + h.Run("clone", h.TfsUrl, "$/MyProject"); + h.AssertGitRepo("MyProject"); + h.AssertCleanWorkspace("MyProject"); + } } } diff --git a/GitTfsTest/Integration/IntegrationHelper.cs b/GitTfsTest/Integration/IntegrationHelper.cs index bc27620d7..02b7aac3e 100644 --- a/GitTfsTest/Integration/IntegrationHelper.cs +++ b/GitTfsTest/Integration/IntegrationHelper.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; +using System.Linq; using System.Reflection; using System.Text; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -177,6 +178,14 @@ public void AssertEmptyWorkspace(string repodir) Assert.AreEqual("", String.Join(", ", entries.ToArray()), "other entries in " + repodir); } + public void AssertCleanWorkspace(string repodir) + { + var repo = new LibGit2Sharp.Repository(Path.Combine(Workdir, repodir)); + var status = repo.Index.RetrieveStatus(); + var statusString = String.Join("\n", status.Select(statusEntry => "" + statusEntry.State + ": " + statusEntry.FilePath).ToArray()); + Assert.AreEqual("", statusString, "repo status"); + } + public void AssertFileInWorkspace(string repodir, string file, string contents) { var path = Path.Combine(Workdir, repodir, file);