Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge #200
Conflicts:
	GitTfsTest/Integration/CloneTests.cs
  • Loading branch information
spraints committed Aug 12, 2012
2 parents e79056a + 3ff7e7a commit aba2485
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
19 changes: 19 additions & 0 deletions GitTfsTest/Integration/CloneTests.cs
Expand Up @@ -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");
}
}
}
9 changes: 9 additions & 0 deletions GitTfsTest/Integration/IntegrationHelper.cs
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit aba2485

Please sign in to comment.