This will simplify to adapt EGit to the removal of FileRepository from
jgit's public API in change I2ab1327c202ef2003565e1b0770a583970e432e9.
Change-Id: If98b0b97e8f13a94d4ea7ba1be0f90d82b0fba4b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
throw new RepositoryNotFoundException(getGitDir());
return repo;
}
+
+ /**
+ * Convenience factory method to construct a {@link FileRepository}.
+ *
+ * @param gitDir
+ * {@code GIT_DIR}, the repository meta directory.
+ * @return a repository matching this configuration.
+ * @throws IOException
+ * the repository could not be accessed to configure the rest of
+ * the builder's parameters.
+ */
+ public static Repository create(File gitDir) throws IOException {
+ return new FileRepositoryBuilder().setGitDir(gitDir).readEnvironment()
+ .build();
+ }
}