cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject git commit: Fix repo-status command when --branch2 is omitted.
Date Fri, 06 Sep 2013 05:08:17 GMT
Updated Branches:
  refs/heads/master edb206f4e -> 13570beb7


Fix repo-status command when --branch2 is omitted.


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

Branch: refs/heads/master
Commit: 13570beb709e2dbfe3db405ef9851d5cf48312e1
Parents: edb206f
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Fri Sep 6 01:08:01 2013 -0400
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Fri Sep 6 01:08:01 2013 -0400

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


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/13570beb/coho
----------------------------------------------------------------------
diff --git a/coho b/coho
index ed78386..d0d9d38 100755
--- a/coho
+++ b/coho
@@ -769,10 +769,10 @@ function repoStatusCommand(argv) {
         process.exit(1);
     }
     var branches = Array.isArray(argv.b) ? argv.b : [argv.b];
-    var branches2 = Array.isArray(argv.branch2) ? argv.branch2 : [argv.branch2];
+    var branches2 = argv.branch2 && (Array.isArray(argv.branch2) ? argv.branch2 :
[argv.branch2]);
     var repos = computeReposFromFlag(argv.r);
 
-    if (branches.length != branches2.length) {
+    if (branches2 && branches.length != branches2.length) {
         fatal('Must specify the same number of --branch and --branch2 flags');
     }
 
@@ -786,7 +786,7 @@ function repoStatusCommand(argv) {
             if (!localBranchExists(branchName)) {
                 return;
             }
-            var targetBranch = branches2[i] || (remoteBranchExists(repo, branchName) ? repo.remoteName
+ '/' + branchName : 'master');
+            var targetBranch = branches2 ? branches2[i] : (remoteBranchExists(repo, branchName)
? repo.remoteName + '/' + branchName : 'master');
             var changes = execHelper('git log --oneline ' + targetBranch + '..' + branchName,
true);
             if (changes) {
                 logs += repo.repoName + ' on branch ' + branchName + ' (vs ' + targetBranch
+ '): Commits exist.\n';


Mime
View raw message