public class PushCommand extends TransportCommand<PushCommand,java.lang.Iterable<PushResult>>
Push command. It has setters for all
supported options and arguments of this command and a call() method
to finally execute the command.| Modifier and Type | Field and Description |
|---|---|
private boolean |
atomic |
private boolean |
dryRun |
private boolean |
force |
private ProgressMonitor |
monitor |
private java.io.OutputStream |
out |
private java.util.List<java.lang.String> |
pushOptions |
private java.lang.String |
receivePack |
private java.util.Map<java.lang.String,RefLeaseSpec> |
refLeaseSpecs |
private java.util.List<RefSpec> |
refSpecs |
private java.lang.String |
remote |
private boolean |
thin |
credentialsProvider, timeout, transportConfigCallbackrepo| Modifier | Constructor and Description |
|---|---|
protected |
PushCommand(Repository repo)
Constructor for PushCommand.
|
| Modifier and Type | Method and Description |
|---|---|
PushCommand |
add(Ref ref)
Add a reference to push.
|
PushCommand |
add(java.lang.String nameOrSpec)
Add a reference to push.
|
java.lang.Iterable<PushResult> |
call() |
ProgressMonitor |
getProgressMonitor()
Get the progress monitor
|
java.util.List<java.lang.String> |
getPushOptions()
Get push options
|
java.lang.String |
getReceivePack()
Get the name of the remote executable providing the receive-pack service
|
java.util.List<RefLeaseSpec> |
getRefLeaseSpecs()
Get the
RefLeaseSpecs. |
java.util.List<RefSpec> |
getRefSpecs()
Get
RefSpecs. |
java.lang.String |
getRemote()
Get remote name
|
int |
getTimeout()
Get timeout used for push operation
|
boolean |
isAtomic()
Whether this push should be executed atomically (all references updated,
or none)
|
boolean |
isDryRun()
Whether to run the push operation as a dry run
|
boolean |
isForce()
Whether to push forcefully
|
boolean |
isThin()
Get the thin-pack preference
|
PushCommand |
setAtomic(boolean atomic)
Requests atomic push (all references updated, or no updates).
|
PushCommand |
setDryRun(boolean dryRun)
Sets whether the push operation should be a dry run
|
PushCommand |
setForce(boolean force)
Sets the force preference for push operation.
|
PushCommand |
setOutputStream(java.io.OutputStream out)
Sets the output stream to write sideband messages to
|
PushCommand |
setProgressMonitor(ProgressMonitor monitor)
The progress monitor associated with the push operation.
|
PushCommand |
setPushAll()
Push all branches under refs/heads/*.
|
PushCommand |
setPushOptions(java.util.List<java.lang.String> pushOptions)
Set the option strings associated with the push operation.
|
PushCommand |
setPushTags()
Push all tags under refs/tags/*.
|
PushCommand |
setReceivePack(java.lang.String receivePack)
The remote executable providing receive-pack service for pack transports.
|
PushCommand |
setRefLeaseSpecs(java.util.List<RefLeaseSpec> specs)
The ref lease specs to be used in the push operation, for a
force-with-lease push operation.
|
PushCommand |
setRefLeaseSpecs(RefLeaseSpec... specs)
The ref lease specs to be used in the push operation, for a
force-with-lease push operation.
|
PushCommand |
setRefSpecs(java.util.List<RefSpec> specs)
The ref specs to be used in the push operation
|
PushCommand |
setRefSpecs(RefSpec... specs)
The ref specs to be used in the push operation
|
PushCommand |
setRemote(java.lang.String remote)
The remote (uri or name) used for the push operation.
|
PushCommand |
setThin(boolean thin)
Set the thin-pack preference for push operation.
|
configure, configure, self, setCredentialsProvider, setTimeout, setTransportConfigCallbackcheckCallable, getRepository, setCallableprivate java.lang.String remote
private final java.util.List<RefSpec> refSpecs
private final java.util.Map<java.lang.String,RefLeaseSpec> refLeaseSpecs
private ProgressMonitor monitor
private java.lang.String receivePack
private boolean dryRun
private boolean atomic
private boolean force
private boolean thin
private java.io.OutputStream out
private java.util.List<java.lang.String> pushOptions
protected PushCommand(Repository repo)
Constructor for PushCommand.
repo - the Repositorypublic java.lang.Iterable<PushResult> call() throws GitAPIException, InvalidRemoteException, TransportException
Execute the command
Execute the push command with all the options and parameters
collected by the setter methods of this class. Each instance of this
class should only be used for one invocation of the command (means: one
call to call())
call in interface java.util.concurrent.Callable<java.lang.Iterable<PushResult>>call in class GitCommand<java.lang.Iterable<PushResult>>GitAPIExceptionInvalidRemoteExceptionTransportExceptionpublic PushCommand setRemote(java.lang.String remote)
Constants.DEFAULT_REMOTE_NAME will
be used.remote - the remote namethisConstants.DEFAULT_REMOTE_NAMEpublic java.lang.String getRemote()
public PushCommand setReceivePack(java.lang.String receivePack)
RemoteConfig.DEFAULT_RECEIVE_PACK will be used.receivePack - name of the remote executable providing the receive-pack
servicethisRemoteConfig.DEFAULT_RECEIVE_PACKpublic java.lang.String getReceivePack()
public int getTimeout()
public ProgressMonitor getProgressMonitor()
public PushCommand setProgressMonitor(ProgressMonitor monitor)
NullProgressMonitormonitor - a ProgressMonitorthisNullProgressMonitorpublic java.util.List<RefLeaseSpec> getRefLeaseSpecs()
RefLeaseSpecs.RefLeaseSpecspublic PushCommand setRefLeaseSpecs(RefLeaseSpec... specs)
specs - a RefLeaseSpec object.thispublic PushCommand setRefLeaseSpecs(java.util.List<RefLeaseSpec> specs)
specs - list of RefLeaseSpecsthispublic java.util.List<RefSpec> getRefSpecs()
RefSpecs.public PushCommand setRefSpecs(RefSpec... specs)
specs - a RefSpec object.thispublic PushCommand setRefSpecs(java.util.List<RefSpec> specs)
specs - list of RefSpecsthispublic PushCommand setPushAll()
public PushCommand setPushTags()
public PushCommand add(Ref ref)
ref - the source reference. The remote name will match.this.public PushCommand add(java.lang.String nameOrSpec)
nameOrSpec - any reference name, or a reference specification.this.JGitInternalException - the reference name cannot be resolved.public boolean isDryRun()
public PushCommand setDryRun(boolean dryRun)
dryRun - a boolean.thispublic boolean isThin()
public PushCommand setThin(boolean thin)
thin - the thin-pack preference valuethispublic boolean isAtomic()
public PushCommand setAtomic(boolean atomic)
atomic - whether to run the push atomicallythispublic boolean isForce()
public PushCommand setForce(boolean force)
force - whether to push forcefullythispublic PushCommand setOutputStream(java.io.OutputStream out)
out - an OutputStreamthispublic java.util.List<java.lang.String> getPushOptions()
public PushCommand setPushOptions(java.util.List<java.lang.String> pushOptions)
pushOptions - a List of push option stringsthis