git4idea: in push active branches dialog push is enabled if no commits are selected...
authorConstantine Plotnikov <Constantine.Plotnikov@jetbrains.com>
Thu, 5 Nov 2009 14:02:18 +0000 (17:02 +0300)
committerConstantine Plotnikov <Constantine.Plotnikov@jetbrains.com>
Thu, 5 Nov 2009 14:02:18 +0000 (17:02 +0300)
plugins/git4idea/src/git4idea/checkin/GitPushActiveBranchesDialog.java

index 20a88fa74379b42c013f2737619222787cfbd72c..bab3713e72e7a6f0eb18a29f63a7e39afd2dc7e2 100644 (file)
@@ -178,9 +178,6 @@ public class GitPushActiveBranchesDialog extends DialogWrapper {
       if (r.commits.size() == 0) {
         continue;
       }
-      if (r.remoteCommits > 0) {
-        return true;
-      }
       boolean seenCheckedNode = false;
       for (int j = 0; j < node.getChildCount(); j++) {
         if (node.getChildAt(j) instanceof CheckedTreeNode) {
@@ -195,6 +192,9 @@ public class GitPushActiveBranchesDialog extends DialogWrapper {
           }
         }
       }
+      if (seenCheckedNode && r.remoteCommits > 0) {
+        return true;
+      }
     }
     return false;
   }
@@ -357,7 +357,7 @@ public class GitPushActiveBranchesDialog extends DialogWrapper {
         continue;
       }
       Root r = (Root)node.getUserObject();
-      ifseenMerges && seenUnchecked) {
+      if (seenMerges && seenUnchecked) {
         error = GitBundle.getString("push.active.error.merges.unchecked");
       }
       if (seenMerges && reorderNeeded) {