cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From an-s...@apache.org
Subject [3/4] git commit: Code improvements
Date Thu, 09 Oct 2014 14:08:27 GMT
Code improvements


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

Branch: refs/heads/CB-7744
Commit: 27062ccaf9d2dd99d1ff5f7973c06b5171ca56b5
Parents: 5e867f2
Author: maria.bukharina <maria.bukharina@akvelon.com>
Authored: Thu Oct 9 17:42:49 2014 +0400
Committer: maria.bukharina <maria.bukharina@akvelon.com>
Committed: Thu Oct 9 17:42:49 2014 +0400

----------------------------------------------------------------------
 src/repo-clone.js  | 13 ++++---------
 src/repo-update.js |  6 ++----
 2 files changed, 6 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/27062cca/src/repo-clone.js
----------------------------------------------------------------------
diff --git a/src/repo-clone.js b/src/repo-clone.js
index ffc4e9e..362510c 100644
--- a/src/repo-clone.js
+++ b/src/repo-clone.js
@@ -38,10 +38,8 @@ module.exports = function*(argv) {
         process.exit(1);
     }
 
-	var depth = null;
-	if(argv.d) {
-		depth = argv.d;
-	}
+	var depth = argv.d ? argv.d: null;
+    
     var repos = flagutil.computeReposFromFlag(argv.r);
     yield cloneRepos(repos, false, depth);
 }
@@ -63,11 +61,8 @@ function *cloneRepos(repos, quiet, depth) {
         } else if (repo.svn) {
             clonePromises.push(executil.execHelper(executil.ARGS('svn checkout ' + repo.svn
+ ' ' + repo.repoName)));
         } else {
-			if(depth != null) {
-				clonePromises.push(executil.execHelper(executil.ARGS('git clone --depth ' + depth + '
' + createRepoUrl(repo))));
-			} else {
-				clonePromises.push(executil.execHelper(executil.ARGS('git clone ' + createRepoUrl(repo))));
-			}
+			var depthArg = depth == null ? '' : '--depth ' + depth + ' ';			
+			clonePromises.push(executil.execHelper(executil.ARGS('git clone ' + depthArg + createRepoUrl(repo))));
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/27062cca/src/repo-update.js
----------------------------------------------------------------------
diff --git a/src/repo-update.js b/src/repo-update.js
index e6c8e03..2c54839 100644
--- a/src/repo-update.js
+++ b/src/repo-update.js
@@ -60,10 +60,8 @@ module.exports = function*(argv) {
         process.exit(1);
     }
 
-	var depth = null;
-	if(argv.d) {
-		depth = argv.d;
-	}
+	var depth = argv.d ? argv.d: null;
+    
     var branches = Array.isArray(argv.b) ? argv.b : [argv.b];
     var repos = flagutil.computeReposFromFlag(argv.r);
     apputil.prefixLength = Math.max.apply(null,


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message