Add FileRepository(String) convenience constructor

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 commit is contained in:
Ketan Padegaonkar 2010-08-16 19:41:54 -07:00 committed by Shawn O. Pearce
parent 9fc2cdadd2
commit 376acfb6db
1 changed files with 14 additions and 0 deletions

View File

@ -123,6 +123,20 @@ public FileRepository(final File gitDir) throws IOException {
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.
*