title: jGit - how to add all files to staging area
body: <p>I tried in a lot of ways to clone a repo with jGit (it works).
  Then, I write some archive in the repository, and tried to add all (a <code>git add *</code>, <code>git add -A</code> or something like it).. but it don't work. The files simple are not added to the staging area.</p>
  
  <p>My code is like this:</p>
  
  <pre><code>    FileRepositoryBuilder builder = new FileRepositoryBuilder();
      Repository repository = builder.setGitDir(new File(folder))
              .readEnvironment().findGitDir().setup().build();
      CloneCommand clone = Git.cloneRepository();
      clone.setBare(false).setCloneAllBranches(true);
      clone.setDirectory(f).setURI("git@192.168.2.43:test.git");
      try {
          clone.call();
      } catch (GitAPIException e) {
          e.printStackTrace();
      }
      Files.write("testing it...", new File(folder + "/test2.txt"),
              Charsets.UTF_8);
      Git g = new Git(repository);
      g.add().addFilepattern("*").call();
  </code></pre>
  
  <p>What am I doing wrong?
  Thanks.</p>
  
  <hr>
  
  <p>Exception while trying what with addFilePattern("."):</p>
  
  <pre><code>Exception in thread "main" org.eclipse.jgit.errors.NoWorkTreeException: Bare Repository has neither a working tree, nor an index
      at org.eclipse.jgit.lib.Repository.getIndexFile(Repository.java:850)
      at org.eclipse.jgit.dircache.DirCache.lock(DirCache.java:264)
      at org.eclipse.jgit.lib.Repository.lockDirCache(Repository.java:906)
      at org.eclipse.jgit.api.AddCommand.call(AddCommand.java:138)
      at net.ciphersec.git.GitTests.main(GitTests.java:110)
  </code></pre>