When opening a repo in a dir that is a bare repo then GitDb is returned

This commit is contained in:
Paul Campbell 2018-06-02 11:08:25 +01:00
parent b75f228dd7
commit c99e801a69

View file

@ -150,6 +150,21 @@ class GitDBTest implements WithAssertions {
} }
// When opening a repo in a dir that is a bare repo then GitDb is returned // When opening a repo in a dir that is a bare repo then GitDb is returned
@Test
void openRepo_whenGitDB_thenReturnGitDB() throws IOException {
//given
final Path dir = gitDBRepo();
//when
final GitDBLocal gitDB = GitDB.openLocal(dir);
//then
assertThat(gitDB).isNotNull();
}
private Path gitDBRepo() throws IOException {
final Path dbDir = dirDoesNotExist();
GitDB.initLocal(dbDir);
return dbDir;
}
// Given a valid GitDb handle // Given a valid GitDb handle
// When select a branch that doesn't exist then an exception is thrown // When select a branch that doesn't exist then an exception is thrown