I am working on a project using JGit. I managed to delete a branch, but I also want to check if that branch is checked out or not. I found a variable in CheckoutCommand
but it is private:
private boolean isCheckoutIndex() {
return startCommit == null && startPoint == null;
}
No public method returns what I want. When I use the command below on a checked out branch it returns an error that the branch cannot be deleted, so I want to check first if is checked out or not.
git.branchDelete().setForce(true).setBranchNames(branchName).call();