public class DeleteBranchCommand extends GitCommand<List<String>>
call()
is a list with the (full) names of the deleted
branches.
Note that we don't have a setter corresponding to the -r option; remote
tracking branches are simply deleted just like local branches.repo
Modifier | Constructor and Description |
---|---|
protected |
DeleteBranchCommand(Repository repo)
Constructor for DeleteBranchCommand
|
Modifier and Type | Method and Description |
---|---|
List<String> |
call() |
DeleteBranchCommand |
setBranchNames(String... branchnames)
Set the names of the branches to delete
|
DeleteBranchCommand |
setForce(boolean force)
Set whether to forcefully delete branches
|
checkCallable, getRepository, setCallable
protected DeleteBranchCommand(Repository repo)
repo
- the Repository
public List<String> call() throws GitAPIException, NotMergedException, CannotDeleteCurrentBranchException
Execute the command
call
in interface Callable<List<String>>
call
in class GitCommand<List<String>>
GitAPIException
NotMergedException
CannotDeleteCurrentBranchException
public DeleteBranchCommand setBranchNames(String... branchnames)
branchnames
- the names of the branches to delete; if not set, this will do
nothing; invalid branch names will simply be ignoredpublic DeleteBranchCommand setForce(boolean force)
force
- true
corresponds to the -D option,
false
to the -d option (default) false
a check will be performed whether the
branch to be deleted is already merged into the current branch
and deletion will be refused in this caseCopyright © 2018 Eclipse JGit Project. All rights reserved.