title: it fails when git-receive-pack has new line in return
body: <p>I am trying to response to a git-receive-pack request, so if my program return</p>
  
  <pre><code>009c0000000000000000000000000000000000000000 capabilities^{}report-status delete-refs side-band-64k quiet atomic ofs-delta agent=git/2.10.1.(Apple.Git-78)
  </code></pre>
  
  <p>it works and git clients like smartgit will work as well but when the return value has a new line (\n) with 0000 in response just like standard</p>
  
  <pre><code>009c0000000000000000000000000000000000000000 capabilities^{}report-status delete-refs side-band-64k quiet atomic ofs-delta agent=git/2.10.1.(Apple.Git-78)
  0000
  </code></pre>
  
  <p>it does not work and client show me </p>
  
  <pre><code>/test.git/info/refs not valid: is this a git repository
  </code></pre>
  
  <p>what is the problem? I just do as <a href="https://git-scm.com/book/en/v2/Git-Internals-Transfer-Protocols" rel="nofollow noreferrer">https://git-scm.com/book/en/v2/Git-Internals-Transfer-Protocols</a> says.</p>
  
  <p>Thanks in advance</p>