mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-27 08:28:50 +02:00
BIG move towards backbone models and collections for everything
This commit is contained in:
parent
95277013e5
commit
5ac6b035f5
9 changed files with 290 additions and 234 deletions
13
src/git.js
13
src/git.js
|
@ -20,7 +20,7 @@ function GitEngine() {
|
|||
this.commandOptions = {};
|
||||
this.generalArgs = [];
|
||||
|
||||
events.on('gitCommandReady', _.bind(this.dispatch, this));
|
||||
events.on('processCommand', _.bind(this.dispatch, this));
|
||||
|
||||
this.init();
|
||||
}
|
||||
|
@ -675,11 +675,14 @@ GitEngine.prototype.deleteBranch = function(name) {
|
|||
this.branches.splice(toDelete, 1);
|
||||
};
|
||||
|
||||
GitEngine.prototype.dispatch = function(commandObj) {
|
||||
this.commandOptions = commandObj.optionParser.supportedMap;
|
||||
this.generalArgs = commandObj.optionParser.generalArgs;
|
||||
GitEngine.prototype.dispatch = function(command) {
|
||||
// current command, options, and args are stored in the gitEngine
|
||||
// for easy reference during processing.
|
||||
this.command = command;
|
||||
this.commandOptions = command.get('supportedMap');
|
||||
this.generalArgs = command.get('generalArgs');
|
||||
|
||||
this[commandObj.method + 'Starter']();
|
||||
this[command.get('method') + 'Starter']();
|
||||
};
|
||||
|
||||
GitEngine.prototype.addStarter = function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue