public void testFindingConflicts() { var index = new GitIndex(db); index.add(trash, writeTrashFile("bar", "bar")); index.add(trash, writeTrashFile("foo/bar/baz/qux", "foo/bar")); recursiveDelete(new FileInfo(Path.Combine(trash.FullName, "bar"))); recursiveDelete(new DirectoryInfo(Path.Combine(trash.FullName, "foo"))); writeTrashFile("bar/baz/qux/foo", "another nasty one"); writeTrashFile("foo", "troublesome little bugger"); var workDirCheckout = new WorkDirCheckout(db, trash, index, index); workDirCheckout.PrescanOneTree(); List<string> conflictingEntries = workDirCheckout.Conflicts; Assert.AreEqual("bar/baz/qux/foo", conflictingEntries[0]); Assert.AreEqual("foo", conflictingEntries[1]); var index2 = new GitIndex(db); recursiveDelete(new DirectoryInfo(Path.Combine(trash.FullName, "bar"))); recursiveDelete(new DirectoryInfo(Path.Combine(trash.FullName, "foo"))); index2.add(trash, writeTrashFile("bar/baz/qux/foo", "bar")); index2.add(trash, writeTrashFile("foo", "lalala")); workDirCheckout = new WorkDirCheckout(db, trash, index2, index); workDirCheckout.PrescanOneTree(); conflictingEntries = workDirCheckout.Conflicts; List<string> removedEntries = workDirCheckout.Removed; Assert.IsTrue(conflictingEntries.Count == 0); Assert.IsTrue(removedEntries.Contains("bar/baz/qux/foo")); Assert.IsTrue(removedEntries.Contains("foo")); }