Beispiel #1
0
        public void testCacheRegisterOpen()
        {
            DirectoryInfo dir = db.Directory;

            RepositoryCache.register(db);
            using (Core.Repository exact = RepositoryCache.open(RepositoryCache.FileKey.exact(dir)))
            {
                Assert.AreSame(db, exact);
            }

            Assert.IsTrue(dir.Name.EndsWith(Constants.DOT_GIT_EXT));
            Assert.AreEqual(Constants.DOT_GIT, dir.Name);
            DirectoryInfo parent = dir.Parent;

            using (Core.Repository lenient = RepositoryCache.open(RepositoryCache.FileKey.lenient(parent)))
            {
                Assert.AreSame(db, lenient);
            }

            RepositoryCache.close(db);
        }