public void create() throws IOException, ConfigInvalidException { try (Repository git = mgr.openRepository(allUsersName)) { initAllUsers(git); } catch (RepositoryNotFoundException notFound) { try (Repository git = mgr.createRepository(allUsersName)) { initAllUsers(git); } catch (RepositoryNotFoundException err) { String name = allUsersName.get(); throw new IOException("Cannot create repository " + name, err); } } }