Ignore error when some tag on remote was updated

This commit is contained in:
Michal Dorner 2021-03-29 17:09:18 +02:00
parent ad1ae68cd0
commit 208adf42c8
No known key found for this signature in database
GPG key ID: 9EEE04B48DA36786
2 changed files with 6 additions and 2 deletions

View file

@ -71,7 +71,9 @@ export async function getChangesSinceMergeBase(base: string, ref: string, initia
if (baseRef === undefined) {
baseRef = await getFullRef(base)
if (baseRef === undefined) {
await exec('git', ['fetch', '--tags', `--depth=1`, 'origin', base, ref])
await exec('git', ['fetch', '--tags', '--depth=1', 'origin', base, ref], {
ignoreReturnCode: true // returns exit code 1 if tags on remote were updated - we can safely ignore it
})
baseRef = await getFullRef(base)
if (baseRef === undefined) {
throw new Error(`Could not determine what is ${base} - fetch works but it's not a branch or tag`)