diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java index 73850b788..d7e930831 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java @@ -59,6 +59,7 @@ import java.util.List; import org.eclipse.jgit.internal.JGitText; import org.eclipse.jgit.lib.RefUpdate.Result; import org.eclipse.jgit.revwalk.RevWalk; +import org.eclipse.jgit.transport.PushCertificate; import org.eclipse.jgit.transport.ReceiveCommand; /** @@ -85,6 +86,9 @@ public class BatchRefUpdate { /** Should the result value be appended to {@link #refLogMessage}. */ private boolean refLogIncludeResult; + /** Push certificate associated with this update. */ + private PushCertificate pushCert; + /** * Initialize a new batch update. * @@ -195,6 +199,33 @@ public class BatchRefUpdate { return refLogMessage == null; } + /** + * Set a push certificate associated with this update. + *
+ * This usually includes commands to update the refs in this batch, but is not + * required to. + * + * @param cert + * push certificate, may be null. + * @since 4.1 + */ + public void setPushCertificate(PushCertificate cert) { + pushCert = cert; + } + + /** + * Set the push certificate associated with this update. + *
+ * This usually includes commands to update the refs in this batch, but is not
+ * required to.
+ *
+ * @return push certificate, may be null.
+ * @since 4.1
+ */
+ protected PushCertificate getPushCertificate() {
+ return pushCert;
+ }
+
/** @return commands this update will process. */
public List
+ * This usually includes a command to update this ref, but is not required to.
+ *
+ * @param cert
+ * push certificate, may be null.
+ * @since 4.1
+ */
+ public void setPushCertificate(PushCertificate cert) {
+ pushCert = cert;
+ }
+
+ /**
+ * Set the push certificate associated with this update.
+ *
+ * This usually includes a command to update this ref, but is not required to.
+ *
+ * @return push certificate, may be null.
+ * @since 4.1
+ */
+ protected PushCertificate getPushCertificate() {
+ return pushCert;
+ }
+
/**
* Get the status of this update.
*
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java
index b687bb2d7..54eb747e9 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java
@@ -1479,6 +1479,7 @@ public abstract class BaseReceivePack {
batch.setRefLogMessage("push", true); //$NON-NLS-1$
batch.addCommand(toApply);
try {
+ batch.setPushCertificate(getPushCertificate());
batch.execute(walk, updating);
} catch (IOException err) {
for (ReceiveCommand cmd : toApply) {