Files
archived-orca/src/main/git/commit-object-ref.test.ts
T
OrcaWinandOrcaWin 5655698147 fix(git): recognize full SHA-256 commit IDs as local workspace bases (#35010)
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>
2026-10-30 06:50:25 -07:00

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)
})
})