diff --git a/src/git-source-provider.ts b/src/git-source-provider.ts index f723d94..91bbe53 100644 --- a/src/git-source-provider.ts +++ b/src/git-source-provider.ts @@ -179,7 +179,7 @@ export async function getSource(settings: IGitSourceSettings): Promise { // When all history is fetched, the ref we're interested in may have moved to a different // commit (push or force push). If so, fetch again with a targeted refspec. - if (!(await refHelper.testRef(git, settings.ref, settings.commit))) { + if (!settings.refs.startsWith("refs/tags") && !(await refHelper.testRef(git, settings.ref, settings.commit))) { refSpec = refHelper.getRefSpec(settings.ref, settings.commit) await git.fetch(refSpec, fetchOptions) }