Finally fixed async git dispatching and promise chains, fixed rebase level Issue #111

This commit is contained in:
Peter Cottle 2013-07-21 18:40:26 -07:00
parent 380bcfaa4b
commit a95a56241b
6 changed files with 25 additions and 24 deletions

View file

@ -83,12 +83,15 @@ HeadlessGit.prototype.sendCommand = function(value, entireCommandPromise) {
var startTime = new Date().getTime();
util.splitTextCommand(value, function(commandStr) {
var commandObj = new Command({
rawStr: commandStr
});
var thisDeferred = Q.defer();
this.gitEngine.dispatch(commandObj, thisDeferred);
chain = chain.then(thisDeferred.promise);
chain = chain.then(_.bind(function() {
var commandObj = new Command({
rawStr: commandStr
});
var thisDeferred = Q.defer();
this.gitEngine.dispatch(commandObj, thisDeferred);
return thisDeferred.promise;
}, this));
}, this);
chain.then(function() {