fake teamwork better

This commit is contained in:
Peter Cottle 2013-07-16 09:13:11 -07:00
parent 62867c9f43
commit 380bcfaa4b

View file

@ -1142,11 +1142,9 @@ GitEngine.prototype.fakeTeamworkStarter = function() {
} }
this.validateArgBounds(this.generalArgs, 0, 2); this.validateArgBounds(this.generalArgs, 0, 2);
// ugly command line arg parsing // allow formats of: git Faketeamwork 2 or git Faketeamwork side 3
var branch = this.generalArgs[0] || 'master'; var branch = (this.origin.refs[this.generalArgs[0]]) ?
if (!this.origin.refs[branch]) { this.generalArgs[0] || 'master';
branch = 'master';
}
var numToMake = parseInt(this.generalArgs[0], 10) || this.generalArgs[1] || 1; var numToMake = parseInt(this.generalArgs[0], 10) || this.generalArgs[1] || 1;
// make sure its a branch and exists // make sure its a branch and exists