title: JGit: Is there a thread safe way to add and update files
body: <p>The easy way to add or update files in JGit is like this:</p>
  
  <pre><code>  git.add().addFilepattern(file).call()
  </code></pre>
  
  <p>But that assumes that the file exists in the Git working directory.
  If I have a multi-threaded setup (using Scala and Akka), is there a way to work only on a bare repository, writing the data directly to JGit, avoiding having to first write the file in the working directory? </p>
  
  <p>For getting the file, that seems to work with: </p>
  
  <pre><code>  git.getRepository().open(objId).getBytes()
  </code></pre>
  
  <p>Is there something similar for adding or updating files?</p>