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.

View | Details | Raw Unified | Return to bug 229555
Collapse All | Expand All

(-)a/git/src/org/netbeans/modules/git/ui/checkout/AbstractCheckoutRevision.java (+15 lines)
Lines 173-178 Link Here
173
    public void actionPerformed (ActionEvent e) {
173
    public void actionPerformed (ActionEvent e) {
174
        if (e.getSource() == panel.cbCheckoutAsNewBranch) {
174
        if (e.getSource() == panel.cbCheckoutAsNewBranch) {
175
            panel.branchNameField.setEnabled(panel.cbCheckoutAsNewBranch.isSelected());
175
            panel.branchNameField.setEnabled(panel.cbCheckoutAsNewBranch.isSelected());
176
            //#229555: automatically fill in local branch name based on the remote branch name
177
            validateBranchCB();
176
            validate();
178
            validate();
177
        }
179
        }
178
    }
180
    }
Lines 197-202 Link Here
197
        } else {
199
        } else {
198
            branchNameRecommended = true;
200
            branchNameRecommended = true;
199
        }
201
        }
202
        
203
        //#229555: automatically fill in local branch name based on the remote branch name
204
        if (b != null && b.isRemote() && panel.cbCheckoutAsNewBranch.isSelected())
205
        {
206
            //extract "branch_X" from "origin/branch_X" to be the default local branch name
207
            final String localBranch = rev.substring(rev.lastIndexOf("/")+1);
208
            final boolean localBranchExists = branches.containsKey(rev);
209
            if (!localBranchExists)
210
            {
211
                panel.branchNameField.setText(localBranch);
212
            }
213
        }
214
        
200
        validate();
215
        validate();
201
    }
216
    }
202
217

Return to bug 229555