diff options
author | Ketan Padegaonkar <KetanPadegaonkar@gmail.com> | 2010-08-16 19:41:54 -0700 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2010-08-18 16:30:20 -0700 |
commit | 376acfb6db0c18fa405b99c0ee9214a94cee582a (patch) | |
tree | c3f650052cd19b0ec4bd6326e40a750de54f9e37 | |
parent | 9fc2cdadd211ea9d93e96151a3adede4c0575cd4 (diff) | |
download | jgit-376acfb6db0c18fa405b99c0ee9214a94cee582a.tar.gz jgit-376acfb6db0c18fa405b99c0ee9214a94cee582a.zip |
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
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileRepository.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileRepository.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileRepository.java index 69cce71cf0..9ee1e605e2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileRepository.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileRepository.java @@ -124,6 +124,20 @@ public class FileRepository extends Repository { } /** + * 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. * * @param options |