diff options
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/hooks/PrePushHook.java')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/hooks/PrePushHook.java | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PrePushHook.java b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PrePushHook.java index 535c6b9483..43dbc37f4f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PrePushHook.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PrePushHook.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 Obeo. and others + * Copyright (C) 2015, 2022 Obeo and others * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0 which is available at @@ -38,6 +38,8 @@ public class PrePushHook extends GitHook<String> { private String refs; + private boolean dryRun; + /** * Constructor for PrePushHook * <p> @@ -145,6 +147,27 @@ public class PrePushHook extends GitHook<String> { } /** + * Sets whether the push is a dry run. + * + * @param dryRun + * {@code true} if the push is a dry run, {@code false} otherwise + * @since 6.2 + */ + public void setDryRun(boolean dryRun) { + this.dryRun = dryRun; + } + + /** + * Tells whether the push is a dry run. + * + * @return {@code true} if the push is a dry run, {@code false} otherwise + * @since 6.2 + */ + protected boolean isDryRun() { + return dryRun; + } + + /** * Set Refs * * @param toRefs |