This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
public void actionPerformed (ActionEvent e) {
if (e.getSource() == panel.cbCheckoutAsNewBranch) {
panel.branchNameField.setEnabled(panel.cbCheckoutAsNewBranch.isSelected());
//#229555: automatically fill in local branch name based on the remote branch name
validateBranchCB();
validate();
}
} else {
branchNameRecommended = true;
if (b != null && b.isRemote() && panel.cbCheckoutAsNewBranch.isSelected())
{
//extract "branch_X" from "origin/branch_X" to be the default local branch name
final String localBranch = rev.substring(rev.lastIndexOf("/")+1);
final boolean localBranchExists = branches.containsKey(rev);
if (!localBranchExists)
panel.branchNameField.setText(localBranch);