public class CheckoutCommand extends GitCommand<Ref>
repo| Modifier | Constructor and Description |
|---|---|
protected |
CheckoutCommand(Repository repo) |
| Modifier and Type | Method and Description |
|---|---|
CheckoutCommand |
addPath(String path) |
Ref |
call() |
protected CheckoutCommand |
checkoutPaths()
Checkout paths into index and working directory
|
CheckoutResult |
getResult() |
CheckoutCommand |
setCreateBranch(boolean createBranch) |
CheckoutCommand |
setForce(boolean force) |
CheckoutCommand |
setName(String name) |
CheckoutCommand |
setStartPoint(RevCommit startCommit) |
CheckoutCommand |
setStartPoint(String startPoint) |
CheckoutCommand |
setUpstreamMode(CreateBranchCommand.SetupUpstreamMode mode) |
checkCallable, getRepository, setCallableprotected CheckoutCommand(Repository repo)
repo - public Ref call() throws JGitInternalException, RefAlreadyExistsException, RefNotFoundException, InvalidRefNameException
RefAlreadyExistsException - when trying to create (without force) a branch with a name
that already existsRefNotFoundException - if the start point or branch can not be foundInvalidRefNameException - if the provided name is null or otherwise
invalidJGitInternalExceptionpublic CheckoutCommand addPath(String path)
path - Path to update in the working tree and index.thisprotected CheckoutCommand checkoutPaths() throws IOException, RefNotFoundException
IOExceptionRefNotFoundExceptionpublic CheckoutCommand setName(String name)
name - the name of the new branchpublic CheckoutCommand setCreateBranch(boolean createBranch)
createBranch - if true a branch will be created as part of the
checkout and set to the specified start pointpublic CheckoutCommand setForce(boolean force)
force - 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 changedpublic CheckoutCommand setStartPoint(String startPoint)
startPoint - corresponds to the start-point option; if null,
the current HEAD will be usedpublic CheckoutCommand setStartPoint(RevCommit startCommit)
startCommit - corresponds to the start-point option; if null,
the current HEAD will be usedpublic CheckoutCommand setUpstreamMode(CreateBranchCommand.SetupUpstreamMode mode)
mode - corresponds to the --track/--no-track options; may be
nullpublic CheckoutResult getResult()
Copyright © 2012. All Rights Reserved.