|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jgit.api.GitCommand<Iterable<PushResult>>
org.eclipse.jgit.api.PushCommand
public class PushCommand
A class used to execute a Push
command. It has setters for all
supported options and arguments of this command and a call()
method
to finally execute the command.
Field Summary |
---|
Fields inherited from class org.eclipse.jgit.api.GitCommand |
---|
repo |
Constructor Summary | |
---|---|
protected |
PushCommand(Repository repo)
|
Method Summary | |
---|---|
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 |
setCredentialsProvider(CredentialsProvider credentialsProvider)
|
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 |
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. |
PushCommand |
setTimeout(int timeout)
|
Methods inherited from class org.eclipse.jgit.api.GitCommand |
---|
checkCallable, getRepository, setCallable |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected PushCommand(Repository repo)
repo
- Method Detail |
---|
public Iterable<PushResult> call() throws JGitInternalException, InvalidRemoteException
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()
)
PushResult
objects
InvalidRemoteException
- when called with an invalid remote uri
JGitInternalException
- a low-level exception of JGit has occurred. The original
exception can be retrieved by calling
Throwable.getCause()
.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 PushCommand setTimeout(int timeout)
timeout
- the timeout used for the push operation
this
public int getTimeout()
public ProgressMonitor getProgressMonitor()
public PushCommand setProgressMonitor(ProgressMonitor monitor)
NullProgressMonitor
monitor
-
this
NullProgressMonitor
public List<RefSpec> getRefSpecs()
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) throws JGitInternalException
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 isForce()
public PushCommand setForce(boolean force)
force
-
this
public PushCommand setCredentialsProvider(CredentialsProvider credentialsProvider)
credentialsProvider
- the CredentialsProvider
to use
this
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |