title: Why does `git clone --depth=1 <url>` fail for some repositories with HTTP 500?
body: <p>I'm using a local deployment of Stash as a Git server.</p>
  <p>When cloning certain repositories, like <code>https://stash.mydomain.net/scm/~be2274/chef-repo.git</code>, everything works if I clone without <code>--depth=1</code>, but fails otherwise:</p>
  <p><strong><code>git clone</code> without <code>--depth=1</code>:</strong></p>
  <pre><code>$ git clone -v --bare 'https://stash.mydomain.net/scm/~be2274/chef-repo.git'
  Cloning into bare repository 'chef-repo.git'...
  POST git-upload-pack (gzip 1765 to 943 bytes)
  remote: warning: unable to find all commit-graph files
  remote: Enumerating objects: 434, done.
  remote: Counting objects: 100% (434/434), done.
  remote: Compressing objects: 100% (433/433), done.
  remote: Total 14489 (delta 310), reused 0 (delta 0)
  Receiving objects: 100% (14489/14489), 1.90 MiB | 646.00 KiB/s, done.
  Resolving deltas: 100% (9806/9806), done.
  </code></pre>
  <p><strong><code>git clone</code> with <code>--depth=1</code>:</strong></p>
  <pre><code>$ git clone -v --bare --depth=1 'https://stash.mydomain.net/scm/~be2274/chef-repo.git'
  Cloning into bare repository 'chef-repo.git'...
  POST git-upload-pack (180 bytes)
  error: RPC failed; HTTP 500 curl 18 transfer closed with outstanding read data remaining
  fatal: the remote end hung up unexpectedly
  </code></pre>
  <p>Why does Git fail, when <code>--depth=1</code> is given as an option to <code>git clone</code> to clone only the most recent commit? I have no idea why it's happening, and the error message provides no real information.</p>
  <p>What scenarios would make <code>git clone --depth=1 &lt;url&gt;</code> fail with <code>HTTP 500</code>?</p>