Handle hidden refs (#1774)

Co-authored-by: Chris Gavin <chris@chrisgavin.me>
这个提交包含在:
Orhan Toy
2024-06-12 17:01:40 +02:00
提交者 GitHub
父节点 b80ff79f17
当前提交 b17fe1e4d5
共有 3 个文件被更改,包括 20 次插入 和 2 次删除

查看文件

@ -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}`)) {