diff --git a/scripts/attempt-backport.js b/scripts/attempt-backport.js index 117fbbb9..cad650fb 100644 --- a/scripts/attempt-backport.js +++ b/scripts/attempt-backport.js @@ -156,15 +156,10 @@ function attemptBackport (options, version, isLTS, cb) { debug(`error before exit, code: ${code}, on '${argsString}'`) return } - gitResetBefore() + gitRemoteUpdate() }) } - function gitResetBefore () { - options.logger.debug(`resetting origin/v${version}.x-staging...`) - wrapCP('git', ['reset', `origin/v${version}.x-staging`, '--hard'], gitRemoteUpdate) - } - function gitRemoteUpdate () { options.logger.debug('updating git remotes...') wrapCP('git', ['remote', 'update', '-p'], gitCheckout) @@ -172,16 +167,11 @@ function attemptBackport (options, version, isLTS, cb) { function gitCheckout () { options.logger.debug(`checking out origin/v${version}.x-staging...`) - wrapCP('git', ['checkout', `origin/v${version}.x-staging`], gitClean_fd) - } - - function gitClean_fd () { - wrapCP('git', ['clean', '-fd'], gitReset) + wrapCP('git', ['checkout', `origin/v${version}.x-staging`], gitClean_fdx) } - function gitReset () { - options.logger.debug(`resetting origin/v${version}.x-staging...`) - wrapCP('git', ['reset', `origin/v${version}.x-staging`, '--hard'], fetchDiff) + function gitClean_fdx () { + wrapCP('git', ['clean', '-fdx'], fetchDiff) } function fetchDiff () {