Handle hidden refs

Co-authored-by: Chris Gavin <chris@chrisgavin.me>
This commit is contained in:
Orhan Toy 2024-06-12 07:34:18 +00:00
parent b80ff79f17
commit 4c23a2e9d7
3 changed files with 20 additions and 2 deletions

6
dist/index.js vendored
View file

@ -2000,9 +2000,13 @@ function getCheckoutInfo(git, ref, commit) {
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 (yield git.branchExists(true, `origin/${ref}`)) {