| 1 | import { describe, expect, it } from 'vitest'; |
| 2 | |
| 3 | import { isValidRefName } |
| 4 | |
| 5 | describe('isValidRefName', () |
| 6 | it('accepts names git accepts, including a slash', |
| 7 | for (const name |
| 8 | await expect(isValidRefName |
| 9 | await expect(isValidRefName |
| 10 | } |
| 11 | }); |
| 12 | |
| 13 | it('refuses flags, revision syntax, HEAD and empty names', |
| 14 | for (const name |
| 15 | '', |
| 16 | '-all', |
| 17 | '--delete', |
| 18 | 'HEAD', |
| 19 | 'v1..2', |
| 20 | 'v1^{tree}', |
| 21 | 'a b', |
| 22 | 'v1.lock', |
| 23 | 'x~1', |
| 24 | ]) { |
| 25 | await expect(isValidRefName |
| 26 | } |
| 27 | }); |
| 28 | }); |