diff --git a/lib/repository.js b/lib/repository.js index 77ba9d116..3636c9a6e 100644 --- a/lib/repository.js +++ b/lib/repository.js @@ -455,13 +455,16 @@ Repository.prototype.checkoutRef = function(reference, opts) { * promise, finish() will be called when the * promise resolves. This callback will be * provided a detailed overview of the rebase + * @param {RebaseOptions} rebaseOptions Options to initialize the rebase object + * with * @return {Oid|Index} A commit id for a succesful merge or an index for a * rebase with conflicts */ Repository.prototype.continueRebase = function( signature, beforeNextFn, - beforeFinishFn + beforeFinishFn, + rebaseOptions ) { var repo = this; @@ -474,16 +477,22 @@ Repository.prototype.continueRebase = function( throw index; } - return NodeGit.Rebase.open(repo); + return NodeGit.Rebase.open(repo, rebaseOptions); }) .then(function(_rebase) { rebase = _rebase; return rebase.commit(null, signature) - .catch(function() { + .catch(function(e) { // Ignore all errors to prevent // this routine from choking now // that we made rebase.commit // asynchronous + const errorno = fp.get(["errorno"], e); + if (errorno === NodeGit.Error.CODE.EAPPLIED) { + return; + } + + throw e; }); }) .then(function() { @@ -1505,6 +1514,8 @@ Repository.prototype.isReverting = function() { * promise, finish() will be called when the * promise resolves. This callback will be * provided a detailed overview of the rebase + * @param {RebaseOptions} rebaseOptions Options to initialize the rebase object + * with * @return {Oid|Index} A commit id for a succesful merge or an index for a * rebase with conflicts */