mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
isFullGitObjectId only matched 40-hex IDs, so a saved 64-hex commit base in a SHA-256 repo was treated as missing, triggering an unneeded origin fetch and a fallback to the default branch. Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
12 lines
442 B
TypeScript
12 lines
442 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { isFullGitObjectId } from './commit-object-ref'
|
|
|
|
describe('isFullGitObjectId', () => {
|
|
it('accepts full SHA-1 and SHA-256 object IDs only', () => {
|
|
expect(isFullGitObjectId('a'.repeat(40))).toBe(true)
|
|
expect(isFullGitObjectId('A'.repeat(64))).toBe(true)
|
|
expect(isFullGitObjectId('a'.repeat(63))).toBe(false)
|
|
expect(isFullGitObjectId('a'.repeat(65))).toBe(false)
|
|
})
|
|
})
|