Check out other refs/* by commit if provided, fall back to ref (#1924)

这个提交包含在:
Orhan Toy
2024-10-02 02:24:28 +02:00
提交者 GitHub
父节点 d632683dd7
当前提交 de5a000abf
共有 3 个文件被更改,包括 14 次插入 和 4 次删除

查看文件

@ -77,6 +77,16 @@ describe('ref-helper tests', () => {
expect(checkoutInfo.startPoint).toBeFalsy()
})
it('getCheckoutInfo refs/ without commit', async () => {
const checkoutInfo = await refHelper.getCheckoutInfo(
git,
'refs/non-standard-ref',
''
)
expect(checkoutInfo.ref).toBe('refs/non-standard-ref')
expect(checkoutInfo.startPoint).toBeFalsy()
})
it('getCheckoutInfo unqualified branch only', async () => {
git.branchExists = jest.fn(async (remote: boolean, pattern: string) => {
return true