Top Description Fields Constructors Methods
org.eclipse.jgit.ant.tasks

public Class GitCheckoutTask

extends Task
Class Inheritance
Imports
java.io.File, .IOException, org.apache.tools.ant.BuildException, .Task, org.eclipse.jgit.api.CheckoutCommand, .Git, org.eclipse.jgit.lib.Repository, org.eclipse.jgit.storage.file.FileRepositoryBuilder

Checkout a branch or paths to the working tree.
See Also
git-checkout(1)

Field Summary

Modifier and TypeField and Description
private String
private boolean
private boolean
private File
Inherited from org.apache.tools.ant.Task:
targettaskNametaskTypewrapper

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
execute()

Overrides org.apache.tools.ant.Task.execute.

Called by the project to let the task do its work.

public void
setBranch(String
the initial branch to check out
branch
)

Set branch

public void
setCreateBranch(boolean
whether the branch should be created if it does not already exist
createBranch
)

Set if branch should be created if not yet existing

public void
setForce(boolean
if true and the branch with the given name already exists, the start-point of an existing branch will be set to a new start-point; if false, the existing branch will not be changed
force
)

Set force

public void
setSrc(File
the src to set
src
)

Set the src

Inherited from org.apache.tools.ant.Task:
bindToOwnergetOwningTargetgetRuntimeConfigurableWrappergetTaskNamegetTaskTypegetWrapperhandleErrorFlushhandleErrorOutputhandleFlushhandleInputhandleOutputinitisInvalidloglogloglogmaybeConfigureperformreconfiguresetOwningTargetsetRuntimeConfigurableWrappersetTaskNamesetTaskType

Field Detail

branchback to summary
private String branch
createBranchback to summary
private boolean createBranch
forceback to summary
private boolean force
srcback to summary
private File src

Constructor Detail

GitCheckoutTaskback to summary
public GitCheckoutTask()

Method Detail

executeback to summary
public void execute() throws BuildException

Overrides org.apache.tools.ant.Task.execute.

Doc from org.apache.tools.ant.Task.execute.

Called by the project to let the task do its work. This method may be called more than once, if the task is invoked more than once. For example, if target1 and target2 both depend on target3, then running "ant target1 target2" will run all tasks in target3 twice.

Annotations
@Override
Exceptions
BuildException:
if something goes wrong with the build.
setBranchback to summary
public void setBranch(String branch)

Set branch

Parameters
branch:String

the initial branch to check out

setCreateBranchback to summary
public void setCreateBranch(boolean createBranch)

Set if branch should be created if not yet existing

Parameters
createBranch:boolean

whether the branch should be created if it does not already exist

setForceback to summary
public void setForce(boolean force)

Set force

Parameters
force:boolean

if true and the branch with the given name already exists, the start-point of an existing branch will be set to a new start-point; if false, the existing branch will not be changed

setSrcback to summary
public void setSrc(File src)

Set the src

Parameters
src:File

the src to set