GitBranch { public GitBranchResponse renameBranch(File repositoryPath, boolean forceRename, Ref newName) throws IOException, JavaGitException { CheckUtilities.checkNullArgument(repositoryPath, "repository path"); CheckUtilities.checkNullArgument(newName, "new name"); CheckUtilities.validateArgumentRefType(newName, Ref.RefType.BRANCH, "new name"); IClient client = ClientManager.getInstance().getPreferredClient(); IGitBranch gitBranch = client.getGitBranchInstance(); return gitBranch.renameBranch(repositoryPath, forceRename, newName); }  GitBranchResponse branch(File repositoryPath); GitBranchResponse branch(File repositoryPath, GitBranchOptions options); GitBranchResponse deleteBranch(File repositoryPath, boolean forceDelete, boolean remote, 
      Ref branchName); GitBranchResponse deleteBranch(File repositoryPath, boolean forceDelete, boolean remote, 
      List<Ref> branchList); GitBranchResponse renameBranch(File repositoryPath, boolean forceRename, Ref newName); GitBranchResponse renameBranch(File repositoryPath, boolean forceRename, Ref oldName, 
      Ref newName); GitBranchResponse createBranch(File repositoryPath, Ref branchName); GitBranchResponse createBranch(File repositoryPath, GitBranchOptions options, 
      Ref branchName); GitBranchResponse createBranch(File repositoryPath, Ref branchName, Ref startPoint); GitBranchResponse createBranch(File repositoryPath, GitBranchOptions options, 
      Ref branchName, Ref startPoint);  }
@Test public void testRenameBranch() throws IOException, JavaGitException { Ref branchC = Ref.createBranchRef("branchC"); branch.createBranch(repoDirectory, branchA); branch.createBranch(repoDirectory, branchB); branch.renameBranch(repoDirectory, false, branchA, branchC); branch.renameBranch(repoDirectory, true, branchB); }