@@ -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 |
@@ -83,7 +83,7 @@ public class InitCommand implements Callable<Git> { | |||
} else if (builder.getGitDir() == null) { | |||
File d = new File("."); | |||
if (!bare) | |||
d = new File(d, Constants.DOT_GIT); | |||
d = new File(d, Constants.DOT_GIT).getCanonicalFile(); | |||
builder.setGitDir(d); | |||
} | |||
Repository repository = builder.build(); |