summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorKetan Padegaonkar2010-08-16 22:41:54 (EDT)
committer Shawn O. Pearce2010-08-18 19:30:20 (EDT)
commit376acfb6db0c18fa405b99c0ee9214a94cee582a (patch)
treec3f650052cd19b0ec4bd6326e40a750de54f9e37
parent9fc2cdadd211ea9d93e96151a3adede4c0575cd4 (diff)
downloadjgit-376acfb6db0c18fa405b99c0ee9214a94cee582a.zip
jgit-376acfb6db0c18fa405b99c0ee9214a94cee582a.tar.gz
jgit-376acfb6db0c18fa405b99c0ee9214a94cee582a.tar.bz2
Add FileRepository(String) convenience constructorrefs/changes/22/1322/2
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.java14
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 69cce71..9ee1e60 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