public class PushCommand extends TransportCommand<PushCommand,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.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(String nameOrSpec)
Add a reference to push.
|
Iterable<PushResult> |
call() |
ProgressMonitor |
getProgressMonitor()
Get the progress monitor
|
List<String> |
getPushOptions()
Get push options
|
String |
getReceivePack()
Get the name of the remote executable providing the receive-pack service
|
List<RefLeaseSpec> |
getRefLeaseSpecs()
Get the
RefLeaseSpecs. |
List<RefSpec> |
getRefSpecs()
Get
RefSpecs. |
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(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(List<String> pushOptions)
Set the option strings associated with the push operation.
|
PushCommand |
setPushTags()
Push all tags under refs/tags/*.
|
PushCommand |
setReceivePack(String receivePack)
The remote executable providing receive-pack service for pack transports.
|
PushCommand |
setRefLeaseSpecs(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(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(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, setCallableprotected PushCommand(Repository repo)
Constructor for PushCommand.
repo - the Repositorypublic 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 Callable<Iterable<PushResult>>call in class GitCommand<Iterable<PushResult>>GitAPIExceptionInvalidRemoteExceptionTransportExceptionpublic PushCommand setRemote(String remote)
Constants.DEFAULT_REMOTE_NAME will
be used.remote - the remote namethisConstants.DEFAULT_REMOTE_NAMEpublic String getRemote()
public PushCommand setReceivePack(String receivePack)
RemoteConfig.DEFAULT_RECEIVE_PACK will be used.receivePack - name of the remote executable providing the receive-pack
servicethisRemoteConfig.DEFAULT_RECEIVE_PACKpublic String getReceivePack()
public int getTimeout()
public ProgressMonitor getProgressMonitor()
public PushCommand setProgressMonitor(ProgressMonitor monitor)
NullProgressMonitormonitor - a ProgressMonitorthisNullProgressMonitorpublic List<RefLeaseSpec> getRefLeaseSpecs()
RefLeaseSpecs.RefLeaseSpecspublic PushCommand setRefLeaseSpecs(RefLeaseSpec... specs)
specs - a RefLeaseSpec object.thispublic PushCommand setRefLeaseSpecs(List<RefLeaseSpec> specs)
specs - list of RefLeaseSpecsthispublic PushCommand setRefSpecs(RefSpec... specs)
specs - a RefSpec object.thispublic PushCommand setRefSpecs(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(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(OutputStream out)
out - an OutputStreamthispublic List<String> getPushOptions()
public PushCommand setPushOptions(List<String> pushOptions)
pushOptions - a List of push option stringsthisCopyright © 2018 Eclipse JGit Project. All rights reserved.