Browse Source

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
stable-0.9
Ketan Padegaonkar 14 years ago committed by Shawn O. Pearce
parent
commit
376acfb6db
  1. 14
      org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileRepository.java

14
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileRepository.java

@ -123,6 +123,20 @@ public class FileRepository extends Repository {
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.
*

Loading…
Cancel
Save