n.close();
recursiveDelete(gitdir);
assertFalse(gitdir.exists());
try {
new FileKey(gitdir, db.getFS()).open(true);
fail("incorrectly opened a non existant repository");
} catch (RepositoryNotFoundException e) {
assertEquals("repository not found: " + gitdir.getCanonicalPath(),
e.getMessage());
}
final Repository o = new FileKey(gitdir, db.getFS()).open(false);
assertNotNull(o);
assertEqualsFile(gitdir, o.getDirectory());
assertFalse(gitdir.exists());
}