Permalink
Browse files

Ability to customise remote name for GitLibraryNode

  • Loading branch information...
1 parent 9b15506 commit 1cb9b29cc18b7db6c4db49108545c17adbd92fd1 @narqo narqo committed Mar 7, 2013
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/nodes/lib.js
View
@@ -327,19 +327,23 @@ registry.decl(GitLibraryNodeName, ScmLibraryNodeName, /** @lends GitLibraryNode.
* @param {String[]} [o.paths=['']] Paths to checkout.
* @param {String} [o.treeish] Treeish (commit hash or tag) to checkout.
* @param {String} [o.branch='master'] Branch to checkout.
+ * @param {String} [o.origin='upstream'] Remote name origin.
*/
__constructor: function(o) {
this.__base(o);
this.treeish = o.treeish;
this.branch = o.branch || 'master';
+ this.origin = o.origin || 'upstream';
},
getInitialCheckoutCmd: function(url, target) {
- return UTIL.format('git clone --progress %s %s && cd %s && git checkout %s', url, target, target, this.treeish || this.branch);
+ return UTIL.format('git clone --progress --origin %s %s %s && cd %s && git checkout %s',
+ this.origin, url, target, target, this.treeish || this.branch);
},
getUpdateCmd: function(url, target) {
- return UTIL.format('cd %s && git fetch origin && git reset --hard %s', target, this.treeish || 'origin/' + this.branch);
+ return UTIL.format('cd %s && git fetch %s && git reset --hard %s',
+ target, this.origin, this.treeish || this.origin + '/' + this.branch);
}
});

0 comments on commit 1cb9b29

Please sign in to comment.