matthiasblaesing commented on code in PR #9385:
URL: https://github.com/apache/netbeans/pull/9385#discussion_r3242139372


##########
ide/git/src/org/netbeans/modules/git/ui/push/PushMapping.java:
##########
@@ -44,11 +44,17 @@ public abstract class PushMapping extends ItemSelector.Item 
{
     private static final String COLOR_MODIFIED = 
GitUtils.getColorString(AnnotationColorProvider.getInstance().MODIFIED_FILE.getActualColor());
     private static final String COLOR_REMOVED = 
GitUtils.getColorString(AnnotationColorProvider.getInstance().REMOVED_FILE.getActualColor());
     private static final String COLOR_CONFLICT = 
GitUtils.getColorString(AnnotationColorProvider.getInstance().CONFLICT_FILE.getActualColor());
-    
-    protected PushMapping (String localName, String localId, String 
remoteName, boolean conflict, boolean preselected, boolean updateNeeded) {
+    private final boolean active;
+
+    protected PushMapping (String localName, String localId, String 
remoteName, boolean conflict, boolean preselected, boolean updateNeeded, 
boolean active) {
         super(preselected, localName == null || conflict);
         this.localName = localName;
         this.remoteName = remoteName == null ? localName : remoteName;
+        this.active = active;
+        String displayName = localName;
+        if (active && localName != null) {
+            displayName = localName + " (active)"; //NOI18N

Review Comment:
   I think the `NOI18N` tag is invalid here. If anyone wants to localize this 
is a good candidate.



##########
ide/git/src/org/netbeans/modules/git/ui/push/PushBranchesStep.java:
##########
@@ -160,7 +161,7 @@ protected void perform () {
                                 }
                             }
                         }
-                        boolean preselected = !conflicted && updateNeeded;
+                        boolean preselected = !conflicted && (updateNeeded || 
branch.isActive());

Review Comment:
   I think the `branch.isActive()` check should only be considered if 
`remoteBranch` is `null`. If `remoteBranch` is non-null, the logic already does 
the right thing, only new branches need to be considered.
   
   Currently this can happen:
   
   <img width="552" height="191" alt="Image" 
src="https://github.com/user-attachments/assets/b0b8ceb9-1ca0-4b43-a19a-faa5d77756c8";
 />
   
   The checked state for the active branch makes no sense, as there is nothing 
to push.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to