diff options
| author | Orhan Toy <orhantoy@github.com> | 2024-10-02 02:24:28 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-01 20:24:28 -0400 |
| commit | 0bd055484c994e774f464ab246385ade83f7f553 (patch) | |
| tree | 618c5b7cd871818823f0867c251f062575659f73 /__test__ | |
| parent | 9e9be721c812de2127a8080b70e59b191b52ad01 (diff) | |
Check out other refs/* by commit if provided, fall back to ref (#1924)
Diffstat (limited to '__test__')
| -rw-r--r-- | __test__/ref-helper.test.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/__test__/ref-helper.test.ts b/__test__/ref-helper.test.ts index d3b00b7..5c8d76b 100644 --- a/__test__/ref-helper.test.ts +++ b/__test__/ref-helper.test.ts @@ -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 |
