Resolves #160 handle case where the rebase is empty and theres nothing to do during git pull --rebase

This commit is contained in:
Peter Cottle 2014-02-12 14:20:09 -08:00
parent d6429b241e
commit 0be3577572
2 changed files with 25 additions and 1 deletions

View file

@ -1351,7 +1351,24 @@ GitEngine.prototype.pullFinishWithRebase = function(
chain = chain.then(_.bind(function() {
pendingFetch.dontResolvePromise = true;
return this.rebase(remoteBranch, localBranch, pendingFetch);
try {
return this.rebase(remoteBranch, localBranch, pendingFetch);
} catch (err) {
this.filterError(err);
// we make one exception here to match the behavior of
// git pull --rebase. If the rebase is empty we just
// simply checkout the new location
if (err.getMsg() !== intl.str('git-error-rebase-none')) {
throw err;
}
this.setTargetLocation(
localBranch,
this.getCommitFromRef(remoteBranch)
);
this.checkout(localBranch);
return this.animationFactory.playRefreshAnimation(this.gitVisuals);
}
}, this));
chain = chain.fail(catchShortCircuit);