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) |
| 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()
Executes the
push command with all the options and parameters
collected by the setter methods of this class. |
ProgressMonitor |
getProgressMonitor() |
String |
getReceivePack() |
List<RefSpec> |
getRefSpecs() |
String |
getRemote() |
int |
getTimeout() |
boolean |
isDryRun() |
boolean |
isForce() |
boolean |
isThin() |
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 |
setPushTags()
Push all tags under refs/tags/*.
|
PushCommand |
setReceivePack(String receivePack)
The remote executable providing receive-pack service for pack transports.
|
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)
Sets the thin-pack preference for push operation.
|
configure, configure, self, setCredentialsProvider, setTimeout, setTransportConfigCallbackcheckCallable, getRepository, setCallableprotected PushCommand(Repository repo)
repo - public Iterable<PushResult> call() throws GitAPIException, InvalidRemoteException, TransportException
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>>PushResult objectsInvalidRemoteException - when called with an invalid remote uriTransportException - when an error occurs with the transportGitAPIExceptionpublic PushCommand setRemote(String remote)
Constants.DEFAULT_REMOTE_NAME will
be used.remote - thisConstants.DEFAULT_REMOTE_NAMEpublic String getRemote()
public PushCommand setReceivePack(String receivePack)
RemoteConfig.DEFAULT_RECEIVE_PACK will be used.receivePack - thisRemoteConfig.DEFAULT_RECEIVE_PACKpublic String getReceivePack()
public int getTimeout()
public ProgressMonitor getProgressMonitor()
public PushCommand setProgressMonitor(ProgressMonitor monitor)
NullProgressMonitormonitor - thisNullProgressMonitorpublic PushCommand setRefSpecs(RefSpec... specs)
specs - thispublic PushCommand setRefSpecs(List<RefSpec> specs)
specs - thispublic 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 - thispublic boolean isThin()
public PushCommand setThin(boolean thin)
thin - thispublic boolean isForce()
public PushCommand setForce(boolean force)
force - thispublic PushCommand setOutputStream(OutputStream out)
out - thisCopyright © 2014. All rights reserved.