aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java
index 65dbf12b2f..a7ce1d7c21 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java
@@ -34,6 +34,7 @@ import static org.eclipse.jgit.transport.GitProtocolConstants.OPTION_SHALLOW;
import static org.eclipse.jgit.transport.GitProtocolConstants.OPTION_SIDEBAND_ALL;
import static org.eclipse.jgit.transport.GitProtocolConstants.OPTION_SIDE_BAND;
import static org.eclipse.jgit.transport.GitProtocolConstants.OPTION_SIDE_BAND_64K;
+import static org.eclipse.jgit.transport.GitProtocolConstants.OPTION_SESSION_ID;
import static org.eclipse.jgit.transport.GitProtocolConstants.OPTION_THIN_PACK;
import static org.eclipse.jgit.transport.GitProtocolConstants.OPTION_WAIT_FOR_DONE;
import static org.eclipse.jgit.transport.GitProtocolConstants.PACKET_ACK;
@@ -1382,6 +1383,10 @@ public class UploadPack implements Closeable {
: "")
+ OPTION_SHALLOW);
caps.add(CAPABILITY_SERVER_OPTION);
+ if (transferConfig.isAllowReceiveClientSID()) {
+ caps.add(OPTION_SESSION_ID);
+ }
+
return caps;
}
@@ -1700,6 +1705,21 @@ public class UploadPack implements Closeable {
return userAgent;
}
+ /**
+ * Get the session ID if received from the client.
+ *
+ * @return The session ID if it has been received from the client.
+ * @since 6.4
+ */
+ @Nullable
+ public String getClientSID() {
+ if (currentRequest == null) {
+ return null;
+ }
+
+ return currentRequest.getClientSID();
+ }
+
private boolean negotiate(FetchRequest req,
PackStatistics.Accumulator accumulator,
PacketLineOut pckOut)