public void testDelete() { var index = new GitIndex(db); writeTrashFile("a/b", "data:a/b"); writeTrashFile("a@b", "data:a:b"); writeTrashFile("a.b", "data:a.b"); index.add(trash, new FileInfo(Path.Combine(trash.FullName, "a/b"))); index.add(trash, new FileInfo(Path.Combine(trash.FullName, "a@b"))); index.add(trash, new FileInfo(Path.Combine(trash.FullName, "a.b"))); index.write(); index.writeTree(); index.remove(trash, new FileInfo(Path.Combine(trash.FullName, "a@b"))); index.write(); Assert.AreEqual("a.b", index.Members[0].Name); Assert.AreEqual("a/b", index.Members[1].Name); var indexr = new GitIndex(db); indexr.Read(); Assert.AreEqual("a.b", indexr.Members[0].Name); Assert.AreEqual("a/b", indexr.Members[1].Name); if (CanRunGitStatus) { Assert.AreEqual(0, System(trash, "git status")); } }
private void RemoveFile(FileInfo path, bool delete_file) { GitIndex.remove(_repo._internal_repo.WorkingDirectory, path); // Todo: change GitIndex.Remove to remove(DirectoryInfo , FileInfo) ?? if (delete_file) { path.Delete(); } }