-
Hello folks, I am integrating my custom transport protocol and I am struck trying to understand the logic behind libgit2 smart protocol library implementation. I am trying to implement a transport for our service. For simplicity the transport is a git protocol wrapped into HTTPS with extra authentication and validation. My implementation essentially sets up the connection and then simply reads/writes from the pipe and let libgit2 to deal with the git protocol parsing/handling. Besides the complexity with authentication, there is nothing special about the service, it is a simple gerrit that serves traffic using git protocol. Here is an example of the initial communication sequence:
Now I call But I don't quite understand why. I started looking at the libgit2 code, libgit2/src/libgit2/transports/smart.c Line 130 in 585210a git_smart__connect() -> git_smart__store_refs() -> git_pkt_parse_line() -> ref_pkt() -> if (len < oid_hexsize . 000eversion 2 pktline is not handled by git_pkt_parse_line and passed down to ref_pkt . That function for some reason expects the line starts with SHA1 and then followed by capabilities. My server reply does not match this format. I even checked the protocol docs here https://git-scm.com/docs/protocol-v2 The doc says capabilities have its own pktline, and my server reply seems valid.
Could anyone explain what exactly |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Or does it mean that libgit2 did not implement git protocol v2 yet? |
Beta Was this translation helpful? Give feedback.
That's right. I started doing some refactoring here but at the moment we don't support v2