public class RenameBranchCommand extends GitCommand<Ref>
repo| Modifier | Constructor and Description |
|---|---|
protected |
RenameBranchCommand(Repository repo) |
| Modifier and Type | Method and Description |
|---|---|
Ref |
call()
Executes the command
|
RenameBranchCommand |
setNewName(String newName) |
RenameBranchCommand |
setOldName(String oldName) |
checkCallable, getRepository, setCallableprotected RenameBranchCommand(Repository repo)
repo - public Ref call() throws GitAPIException, RefNotFoundException, InvalidRefNameException, RefAlreadyExistsException, DetachedHeadException
GitCommandcall in interface Callable<Ref>call in class GitCommand<Ref>RefNotFoundException - if the old branch can not be found (branch with provided old
name does not exist or old name resolves to a tag)InvalidRefNameException - if the provided new name is null or otherwise
invalidRefAlreadyExistsException - if a branch with the new name already existsDetachedHeadException - if rename is tried without specifying the old name and HEAD
is detachedGitAPIException - or subclass thereof when an error occurspublic RenameBranchCommand setNewName(String newName)
newName - the new namepublic RenameBranchCommand setOldName(String oldName)
oldName - the name of the branch to rename; if not set, the currently
checked out branch (if any) will be renamedCopyright © 2014. All rights reserved.