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:
parent
9fc2cdadd2
commit
376acfb6db
|
@ -123,6 +123,20 @@ public FileRepository(final File gitDir) throws IOException {
|
||||||
this(new FileRepositoryBuilder().setGitDir(gitDir).setup());
|
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.
|
* Create a repository using the local file system.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue