]> source.dussan.org Git - jgit.git/commit
ReceivePack: Receive and parse client session-id. 23/196323/14
authorJosh Brown <sjoshbrown@google.com>
Tue, 11 Oct 2022 21:56:09 +0000 (14:56 -0700)
committerIvan Frade <ifrade@google.com>
Thu, 27 Oct 2022 20:17:50 +0000 (16:17 -0400)
commit93097f001854af47db782462e78d67e7171043a4
treef9b33a9695fc9cef5478e0930b9d00c3182de272
parentad9c217f4954dc50f629b3eb6ae387b6940a5023
ReceivePack: Receive and parse client session-id.

Before this change JGit did not support the session-id capability
implemented by native Git. This change implements advertising the
capability from the server and parsing the session-id received from
the client during a ReceivePack operation.

Enable the transfer.advertisesid config setting to advertise the
capability from the server. The client may send a session-id capability
in response. If received, the value from this is parsed and available
via the getClientSID method on the ReceivePack object. All capabilities
in the form `capability=value` are now split into key value pairs at the
first `=` character. This change replaces specific handling for the
agent capability.

This change does not add advertisement or parsing to UploadPack. This
change also does not add the ability to send a session ID from the JGit
client.

https://git-scm.com/docs/protocol-v2/2.33.0#_session_idsession_id

Change-Id: I56fb115e843b11b27e128c4ac427b05d5ec129d0
Signed-off-by: Josh Brown <sjoshbrown@google.com>
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitSmartHttpTools.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/transport/parser/FirstCommandTest.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/internal/transport/parser/FirstCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/GitProtocolConstants.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/UserAgent.java