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, transportConfigCallback
repo
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() |
List<String> |
getPushOptions() |
String |
getReceivePack() |
List<RefSpec> |
getRefSpecs() |
String |
getRemote() |
int |
getTimeout() |
boolean |
isAtomic() |
boolean |
isDryRun() |
boolean |
isForce() |
boolean |
isThin() |
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)
Sets 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 |
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, setTransportConfigCallback
checkCallable, getRepository, setCallable
protected 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 transportGitAPIException
public PushCommand setRemote(String remote)
Constants.DEFAULT_REMOTE_NAME
will
be used.remote
- this
Constants.DEFAULT_REMOTE_NAME
public String getRemote()
public PushCommand setReceivePack(String receivePack)
RemoteConfig.DEFAULT_RECEIVE_PACK
will be used.receivePack
- this
RemoteConfig.DEFAULT_RECEIVE_PACK
public String getReceivePack()
public int getTimeout()
public ProgressMonitor getProgressMonitor()
public PushCommand setProgressMonitor(ProgressMonitor monitor)
NullProgressMonitor
monitor
- this
NullProgressMonitor
public PushCommand setRefSpecs(RefSpec... specs)
specs
- this
public PushCommand setRefSpecs(List<RefSpec> specs)
specs
- this
public 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
- this
public boolean isThin()
public PushCommand setThin(boolean thin)
thin
- this
public boolean isAtomic()
public PushCommand setAtomic(boolean atomic)
atomic
- this
public boolean isForce()
public PushCommand setForce(boolean force)
force
- this
public PushCommand setOutputStream(OutputStream out)
out
- this
public List<String> getPushOptions()
public PushCommand setPushOptions(List<String> pushOptions)
pushOptions
- this
Copyright © 2016 Eclipse JGit Project. All rights reserved.