summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/InitCommand.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/InitCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/InitCommand.java
index d68f4e27f2..5b96cddac6 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/InitCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/InitCommand.java
@@ -82,8 +82,10 @@ public class InitCommand implements Callable<Git> {
builder.setGitDir(d);
} else if (builder.getGitDir() == null) {
File d = new File(".");
+ if (d.getParentFile() != null)
+ d = d.getParentFile();
if (!bare)
- d = new File(d, Constants.DOT_GIT).getCanonicalFile();
+ d = new File(d, Constants.DOT_GIT);
builder.setGitDir(d);
}
Repository repository = builder.build();