mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-25 07:28:35 +02:00
Resolves #160 handle case where the rebase is empty and theres nothing to do during git pull --rebase
This commit is contained in:
parent
d6429b241e
commit
0be3577572
2 changed files with 25 additions and 1 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue