title: Old submodule leads to error in tree (tree contains duplicate file entries)
body: <p>I am trying to migrate a repository from Bitbucket to GitHub which fails due to an error in the tree.</p>
  
  <p><code>git fsck</code> gives the following output:</p>
  
  <pre><code>Checking object directories: 100% (256/256), done.
  warning in tree 86b6f36a93c983faab565674a0b92f93fb22cfc7: nullSha1: contains entries pointing to null sha1
  error in tree 86b6f36a93c983faab565674a0b92f93fb22cfc7: duplicateEntries: contains duplicate file entries
  </code></pre>
  
  <p>Checking the malicious tree hash with <code>git ls-tree 86b6f36a93c983faab565674a0b92f93fb22cfc7</code> </p>
  
  <p>Gives me--among others--these lines:</p>
  
  <pre><code>160000 commit 0000000000000000000000000000000000000000  foobar
  040000 tree 2abdf38e2288bca8be24df800372c6a96ecef111    foobar
  </code></pre>
  
  <p>I know that the first line <a href="https://stackoverflow.com/questions/1992018/git-submodule-update-needed-only-initially/2227598#2227598">stands for a deleted sub module</a>. I would like to remove the reference to this from the history to allow me to push this to GitHub.</p>