title: Creating a new local repository with JGit fails "with Bare Repository has neither a working tree..."
body: <p>I am attempting to use JGit to create a local non-bare repository. I create the directory, then create a <code>Repository</code> object for that directory, then I use <code>repository.create()</code>. My research here shows that this is supposed to create a local non-bare repository. However, the line <code>repository.create()</code> throws an exception </p>
  
  <pre><code>org.eclipse.jgit.errors.NoWorkTreeException: Bare Repository has neither a working tree, nor an index. 
  </code></pre>
  
  <p>This would be the message that I would expect if I had created or referenced a bare repository, and then tried to add files to it. However, this error appears on the line that creates the repository, and I am very clearly making a non-bare repository. The documentation of the create method is: "Create a new Git repository. Repository with working tree is created using this method."</p>
  
  <p>I have verified that the directory is created successfully.</p>
  
  <p>What is going on here?</p>
  
  <pre class="lang-java prettyprint-override"><code>File repositoryPath = "test.git";
  Repository repository = new FileRepository(repositoryPath);
  repository.create(false); // This line throws the error
  </code></pre>