You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2013/09/09 21:32:53 UTC

git commit: Use dev as the default branch for repo-status with plugins

Updated Branches:
  refs/heads/master 17ac6dc3a -> 3060f0dae


Use dev as the default branch for repo-status with plugins


Project: http://git-wip-us.apache.org/repos/asf/cordova-coho/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-coho/commit/3060f0da
Tree: http://git-wip-us.apache.org/repos/asf/cordova-coho/tree/3060f0da
Diff: http://git-wip-us.apache.org/repos/asf/cordova-coho/diff/3060f0da

Branch: refs/heads/master
Commit: 3060f0dae773d2b24308f451979a391bc2215b51
Parents: 17ac6dc
Author: Andrew Grieve <ag...@chromium.org>
Authored: Mon Sep 9 15:27:05 2013 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Sep 9 15:27:05 2013 -0400

----------------------------------------------------------------------
 coho | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/3060f0da/coho
----------------------------------------------------------------------
diff --git a/coho b/coho
index 63fae69..5117590 100755
--- a/coho
+++ b/coho
@@ -723,8 +723,7 @@ function repoStatusCommand(argv) {
     var opt = optimist
         .options('b', {
             alias: 'branch',
-            desc: 'The name of the branch to report on. Can be specified multiple times to specify multiple branches. The local version of the branch is compared with the origin\'s version unless --b2 is specified.',
-            default: 'master'
+            desc: 'The name of the branch to report on. Can be specified multiple times to specify multiple branches. The local version of the branch is compared with the origin\'s version unless --b2 is specified.'
          })
         .options('branch2', {
             desc: 'The name of the branch to diff against. This is origin/$branch by default.'
@@ -745,11 +744,11 @@ function repoStatusCommand(argv) {
         optimist.showHelp();
         process.exit(1);
     }
-    var branches = Array.isArray(argv.b) ? argv.b : [argv.b];
-    var branches2 = argv.branch2 && (Array.isArray(argv.branch2) ? argv.branch2 : [argv.branch2]);
+    var branches = argv.b && (Array.isArray(argv.b) ? argv.b : [argv.b]);
+    var branches2 = branches && argv.branch2 && (Array.isArray(argv.branch2) ? argv.branch2 : [argv.branch2]);
     var repos = computeReposFromFlag(argv.r);
 
-    if (branches2 && branches.length != branches2.length) {
+    if (branches2 && branches && branches.length != branches2.length) {
         fatal('Must specify the same number of --branch and --branch2 flags');
     }
 
@@ -759,7 +758,8 @@ function repoStatusCommand(argv) {
     forEachRepo(repos, function(repo) {
         // Determine remote name.
         updateRepos([repo], [], true);
-        branches.forEach(function(branchName, i) {
+        var actualBranches = branches ? branches : [/^plugin/.test(repo.id) ? 'dev' : 'master'];
+        actualBranches.forEach(function(branchName, i) {
             if (!localBranchExists(branchName)) {
                 return;
             }