GitPushDialog: better logging, rename variable to more correct
authorKirill Likhodedov <Kirill.Likhodedov@jetbrains.com>
Thu, 9 Aug 2012 09:23:42 +0000 (13:23 +0400)
committerKirill Likhodedov <Kirill.Likhodedov@jetbrains.com>
Thu, 9 Aug 2012 09:23:42 +0000 (13:23 +0400)
plugins/git4idea/src/git4idea/push/GitPushDialog.java

index c3ca83983be0d7043e84d8fdbf896aae3834622d..8d665304b9382dbb614140ba79ca9c114a10d250 100644 (file)
@@ -182,7 +182,8 @@ public class GitPushDialog extends DialogWrapper {
       LOG.info("collectInfoToPush...");
       myPushSpecs = pushSpecsForCurrentOrEnteredBranches();
       myGitCommitsToPush = myPusher.collectCommitsToPush(myPushSpecs);
-      LOG.info("collectInfoToPush | Collected commits to push: " + logMessageForCommits(myGitCommitsToPush));
+      LOG.info(String.format("collectInfoToPush | Collected commits to push. Push spec: %s, commits: %s",
+                             myPushSpecs, logMessageForCommits(myGitCommitsToPush)));
       return null;
     }
     catch (VcsException e) {
@@ -210,15 +211,15 @@ public class GitPushDialog extends DialogWrapper {
       String remoteName = currentBranch.getTrackedRemoteName(repository.getProject(), repository.getRoot());
       String trackedBranchName = currentBranch.getTrackedBranchName(repository.getProject(), repository.getRoot());
       GitRemote remote = GitUtil.findRemoteByName(repository, remoteName);
-      GitBranch tracked = findRemoteBranchByName(repository, remote, trackedBranchName);
-      if (remote == null || tracked == null) {
+      GitBranch targetBranch = findRemoteBranchByName(repository, remote, trackedBranchName);
+      if (remote == null || targetBranch == null) {
         Pair<GitRemote,GitBranch> remoteAndBranch = GitUtil.findMatchingRemoteBranch(repository, currentBranch);
         if (remoteAndBranch == null) {
           remote = myRefspecPanel.getSelectedRemote();
-          tracked = GitPusher.NO_TARGET_BRANCH;
+          targetBranch = GitPusher.NO_TARGET_BRANCH;
         } else {
           remote = remoteAndBranch.getFirst();
-          tracked = remoteAndBranch.getSecond();
+          targetBranch = remoteAndBranch.getSecond();
         }
       }
 
@@ -232,10 +233,10 @@ public class GitPushDialog extends DialogWrapper {
           }
           manualBranch = new GitBranch(manualBranchName, false, true);
         }
-        tracked = manualBranch;
+        targetBranch = manualBranch;
       }
 
-      GitPushSpec pushSpec = new GitPushSpec(remote, currentBranch, tracked);
+      GitPushSpec pushSpec = new GitPushSpec(remote, currentBranch, targetBranch);
       defaultSpecs.put(repository, pushSpec);
     }
     return defaultSpecs;