It doesn't work when git-receive-pack has a newline instead
I am trying to respond to a git-receive-pack request, so if my program returns
009c0000000000000000000000000000000000000000 capabilities^{}report-status delete-refs side-band-64k quiet atomic ofs-delta agent=git/2.10.1.(Apple.Git-78)
it works and git clients like smartgit will work, but when the return value is a newline (\ n) with 0000 in response as standard
009c0000000000000000000000000000000000000000 capabilities^{}report-status delete-refs side-band-64k quiet atomic ofs-delta agent=git/2.10.1.(Apple.Git-78)
0000
it doesn't work and the client shows me
/test.git/info/refs not valid: is this a git repository
What is the problem? I just do like https://git-scm.com/book/en/v2/Git-Internals-Transfer-Protocols .
Thank you in advance
source to share
From the doc you link to:
The git -receive-pack command immediately responds with one line for every link it currently has - in this case, only the master branch and its SHA-1. The first line also has a list of server capabilities (here, report status, delete-refs and some others, including client ID).
Where do you get capabilities
as the name of the link? The error message you see indicates that this is not the format expected and I do not see any mention of it (as a link name) in the transport protocols document. I suggest trying refs/heads/master
as you use the document and fork from it.
source to share