Handle hidden refs (#1774)
Some checks failed
Check dist / check-dist (push) Waiting to run
Licensed / Check licenses (push) Waiting to run
Build and Test / build (push) Waiting to run
Build and Test / test (macos-latest) (push) Waiting to run
Build and Test / test (ubuntu-latest) (push) Waiting to run
Build and Test / test (windows-latest) (push) Waiting to run
Build and Test / test-proxy (push) Waiting to run
Build and Test / test-bypass-proxy (push) Waiting to run
Build and Test / test-git-container (push) Waiting to run
CodeQL / Analyze (javascript) (push) Has been cancelled

Co-authored-by: Chris Gavin <chris@chrisgavin.me>
This commit is contained in:
Orhan Toy
2024-06-12 17:01:40 +02:00
committed by GitHub
parent b80ff79f17
commit b17fe1e4d5
3 changed files with 20 additions and 2 deletions

View File

@@ -42,9 +42,13 @@ export async function getCheckoutInfo(
result.ref = `refs/remotes/pull/${branch}`
}
// refs/tags/
else if (upperRef.startsWith('REFS/')) {
else if (upperRef.startsWith('REFS/TAGS/')) {
result.ref = ref
}
// refs/
else if (upperRef.startsWith('REFS/') && commit) {
result.ref = commit
}
// Unqualified ref, check for a matching branch or tag
else {
if (await git.branchExists(true, `origin/${ref}`)) {