Skip to content

Commit 5db19ad

Browse files
committed
attempt-backport: git reset before updating
1 parent 88551a6 commit 5db19ad

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/attempt-backport.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,15 @@ function attemptBackport (options, version, isLTS, cb) {
152152
debug(`error before exit, code: ${code}, on '${argsString}'`)
153153
return
154154
}
155-
gitRemoteUpdate()
155+
gitResetBefore()
156156
})
157157
}
158158

159+
function gitResetBefore () {
160+
options.logger.debug(`resetting origin/v${version}.x-staging...`)
161+
wrapCP('git', ['reset', `origin/v${version}.x-staging`, '--hard'], gitRemoteUpdate)
162+
}
163+
159164
function gitRemoteUpdate () {
160165
options.logger.debug('updating git remotes...')
161166
wrapCP('git', ['remote', 'update', '-p'], gitCheckout)

0 commit comments

Comments
 (0)