mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-27 00:18:56 +02:00
OMG stupid typo
This commit is contained in:
parent
de9d91773a
commit
2f57f4cfe3
11 changed files with 8247 additions and 7977 deletions
|
@ -1,10 +1,12 @@
|
|||
var _ = require('underscore');
|
||||
var Backbone = require('backbone');
|
||||
var Q = require('q');
|
||||
|
||||
var GitEngine = require('../git').GitEngine;
|
||||
var AnimationFactory = require('../visuals/animation/animationFactory').AnimationFactory;
|
||||
var GitVisuals = require('../visuals').GitVisuals;
|
||||
var TreeCompare = require('../git/treeCompare').TreeCompare;
|
||||
var EventBaton = require('../util/eventBaton').EventBaton;
|
||||
|
||||
var Collections = require('../models/collections');
|
||||
var CommitCollection = Collections.CommitCollection;
|
||||
|
@ -33,7 +35,7 @@ HeadlessGit.prototype.init = function() {
|
|||
branches: this.branchCollection,
|
||||
gitVisuals: gitVisuals,
|
||||
animationFactory: animationFactory,
|
||||
events: _.clone(Backbone.Events)
|
||||
eventBaton: new EventBaton()
|
||||
});
|
||||
this.gitEngine.init();
|
||||
};
|
||||
|
@ -44,8 +46,7 @@ HeadlessGit.prototype.sendCommand = function(value) {
|
|||
rawStr: commandStr
|
||||
});
|
||||
console.log('dispatching command "', commandStr, '"');
|
||||
var done = function() {};
|
||||
this.gitEngine.dispatch(commandObj, done);
|
||||
this.gitEngine.dispatch(commandObj, Q.defer());
|
||||
}, this);
|
||||
};
|
||||
|
||||
|
|
|
@ -19,7 +19,10 @@ function GitEngine(options) {
|
|||
this.branchCollection = options.branches;
|
||||
this.commitCollection = options.collection;
|
||||
this.gitVisuals = options.gitVisuals;
|
||||
this.events = options.events;
|
||||
|
||||
this.eventBaton = options.eventBaton;
|
||||
this.eventBaton.stealBaton('processGitCommand', this.dispatch, this);
|
||||
|
||||
this.animationFactory = options.animationFactory ||
|
||||
new AnimationFactoryModule.AnimationFactory();
|
||||
|
||||
|
@ -28,7 +31,6 @@ function GitEngine(options) {
|
|||
this.commandOptions = {};
|
||||
this.generalArgs = [];
|
||||
|
||||
this.events.on('processGitCommand', this.dispatch, this);
|
||||
|
||||
// backbone or something uses _.uniqueId, so we make our own here
|
||||
this.uniqueId = (function() {
|
||||
|
@ -1340,7 +1342,7 @@ GitEngine.prototype.filterError = function(err) {
|
|||
}
|
||||
};
|
||||
|
||||
GitEngine.prototype.dispatch = function(command, callback) {
|
||||
GitEngine.prototype.dispatch = function(command, deferred) {
|
||||
// current command, options, and args are stored in the gitEngine
|
||||
// for easy reference during processing.
|
||||
this.command = command;
|
||||
|
@ -1349,8 +1351,7 @@ GitEngine.prototype.dispatch = function(command, callback) {
|
|||
|
||||
// set up the animation queue
|
||||
var whenDone = _.bind(function() {
|
||||
command.set('status', 'finished');
|
||||
callback();
|
||||
command.finishWith(deferred);
|
||||
}, this);
|
||||
this.animationQueue = new AnimationQueue({
|
||||
callback: whenDone
|
||||
|
@ -1363,7 +1364,7 @@ GitEngine.prototype.dispatch = function(command, callback) {
|
|||
this.filterError(err);
|
||||
// short circuit animation by just setting error and returning
|
||||
command.set('error', err);
|
||||
callback();
|
||||
deferred.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue