Browse Source

Move BaseReceivePack#pushCert getter and setter to ReceivePack

This is a first step toward eliminating the BaseReceivePack API.

Inspired by a larger change by Dan Wang <dwwang@google.com>.

Change-Id: I5c876a67d8db24bf808823d9ea44d991b1ce5277
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-5.3
Jonathan Nieder 6 years ago committed by Matthias Sohn
parent
commit
937beaa1ae
  1. 14
      org.eclipse.jgit/.settings/.api_filters
  2. 14
      org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java
  3. 29
      org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java

14
org.eclipse.jgit/.settings/.api_filters

@ -30,6 +30,20 @@
</message_arguments>
</filter>
</resource>
<resource path="src/org/eclipse/jgit/transport/BaseReceivePack.java" type="org.eclipse.jgit.transport.BaseReceivePack">
<filter id="421650549">
<message_arguments>
<message_argument value="org.eclipse.jgit.transport.BaseReceivePack"/>
<message_argument value="getPushCertificate()"/>
</message_arguments>
</filter>
<filter id="421650549">
<message_arguments>
<message_argument value="org.eclipse.jgit.transport.BaseReceivePack"/>
<message_argument value="setPushCertificate(PushCertificate)"/>
</message_arguments>
</filter>
</resource>
<resource path="src/org/eclipse/jgit/transport/TransferConfig.java" type="org.eclipse.jgit.transport.TransferConfig">
<filter id="1159725059">
<message_arguments>

14
org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java

@ -275,7 +275,7 @@ public abstract class BaseReceivePack {
private PushCertificateParser pushCertificateParser;
private SignedPushConfig signedPushConfig;
private PushCertificate pushCert;
PushCertificate pushCert;
private ReceivedPackStatistics stats;
/**
@ -286,10 +286,10 @@ public abstract class BaseReceivePack {
* @return the parsed certificate, or null if push certificates are disabled
* or no cert was presented by the client.
* @since 4.1
* @deprecated use {@link ReceivePack#getPushCertificate}.
*/
public PushCertificate getPushCertificate() {
return pushCert;
}
@Deprecated
public abstract PushCertificate getPushCertificate();
/**
* Set the push certificate used to verify the pusher's identity.
@ -300,10 +300,10 @@ public abstract class BaseReceivePack {
* @param cert
* the push certificate to set.
* @since 4.1
* @deprecated use {@link ReceivePack#setPushCertificate(PushCertificate)}.
*/
public void setPushCertificate(PushCertificate cert) {
pushCert = cert;
}
@Deprecated
public abstract void setPushCertificate(PushCertificate cert);
/**
* Create a new pack receive for an open repository.

29
org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java

@ -92,6 +92,35 @@ public class ReceivePack extends BaseReceivePack {
postReceive = PostReceiveHook.NULL;
}
/**
* Get the push certificate used to verify the pusher's identity.
* <p>
* Only valid after commands are read from the wire.
*
* @return the parsed certificate, or null if push certificates are disabled
* or no cert was presented by the client.
* @since 4.1
*/
@Override
public PushCertificate getPushCertificate() {
return pushCert;
}
/**
* Set the push certificate used to verify the pusher's identity.
* <p>
* Should only be called if reconstructing an instance without going through
* the normal {@link #recvCommands()} flow.
*
* @param cert
* the push certificate to set.
* @since 4.1
*/
@Override
public void setPushCertificate(PushCertificate cert) {
pushCert = cert;
}
/**
* Gets an unmodifiable view of the option strings associated with the push.
*

Loading…
Cancel
Save