summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm/src
diff options
context:
space:
mode:
authorChris Aniszczyk <caniszczyk@gmail.com>2011-03-15 09:59:24 -0400
committerCode Review <codereview-daemon@eclipse.org>2011-03-15 09:59:24 -0400
commit2df51d942704e7dc8887acb4d76d8723c108cff0 (patch)
tree229d47baa0371a591002b8d523064987e1090e6e /org.eclipse.jgit.pgm/src
parented2a8b5acfffba36b19738f313c2c1758ebf44bf (diff)
parent8e1b581d39a8e1eadfb8f2ab7590546ec89c9abe (diff)
downloadjgit-2df51d942704e7dc8887acb4d76d8723c108cff0.tar.gz
jgit-2df51d942704e7dc8887acb4d76d8723c108cff0.zip
Merge "Make --git-dir optional for 'jgit init'"
Diffstat (limited to 'org.eclipse.jgit.pgm/src')
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Init.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Init.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Init.java
index 98f086d460..e1e38e5bc8 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Init.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Init.java
@@ -69,7 +69,8 @@ class Init extends TextBuiltin {
protected void run() throws Exception {
InitCommand command = Git.init();
command.setBare(bare);
- command.setDirectory(new File(gitdir));
+ if (gitdir != null)
+ command.setDirectory(new File(gitdir));
Repository repository = command.call().getRepository();
out.println(MessageFormat.format(
CLIText.get().initializedEmptyGitRepositoryIn, repository