Resolves #400 -- rebase --pull with just fast forward

This commit is contained in:
Peter Cottle 2016-12-04 10:17:15 -08:00
parent f1f2a3a5b4
commit 8f3f32d82b
2 changed files with 19 additions and 6 deletions

View file

@ -1423,13 +1423,20 @@ GitEngine.prototype.pullFinishWithRebase = function(
chain = chain.then(function() {
pendingFetch.dontResolvePromise = true;
// Lets move the git pull --rebase check up here.
if (this.isUpstreamOf(localBranch, remoteBranch)) {
this.setTargetLocation(
localBranch,
this.getCommitFromRef(remoteBranch)
);
this.checkout(localBranch);
return this.animationFactory.playRefreshAnimation(this.gitVisuals);
}
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;
}
@ -2087,6 +2094,7 @@ GitEngine.prototype.hgRebase = function(destination, base) {
GitEngine.prototype.rebase = function(targetSource, currentLocation, options) {
// first some conditions
debugger;
if (this.isUpstreamOf(targetSource, currentLocation)) {
this.command.setResult(intl.str('git-result-uptodate'));
@ -3057,4 +3065,3 @@ exports.Commit = Commit;
exports.Branch = Branch;
exports.Tag = Tag;
exports.Ref = Ref;