Add a convenience API in FileRepository to pass in a String that
points to the GIT_DIR location. This is converted to a File and
sent through the usual constructor.
Change-Id: I588388f37e89b8c690020f110a1bc59f46170c40
this(new FileRepositoryBuilder().setGitDir(gitDir).setup());
}
+ /**
+ * A convenience API for {@link #FileRepository(File)}.
+ *
+ * @param gitDir
+ * GIT_DIR (the location of the repository metadata).
+ * @throws IOException
+ * the repository appears to already exist but cannot be
+ * accessed.
+ * @see FileRepositoryBuilder
+ */
+ public FileRepository(final String gitDir) throws IOException {
+ this(new File(gitDir));
+ }
+
/**
* Create a repository using the local file system.
*