Fix start-from PR failures for fork-backed PRs (#2233)

* Fix start-from PR failures for some fork PRs

* fix: limit PR fallback fetches to missing refs

---------

Co-authored-by: Neil <4138956+nwparker@users.noreply.github.com>
This commit is contained in:
Anwesh
2026-05-18 00:36:34 -07:00
committed by GitHub
co-authored by Neil
parent 74876aebbc
commit 95577ea9a0
8 changed files with 295 additions and 29 deletions
@@ -0,0 +1,24 @@
import { describe, expect, it } from 'vitest'
import { isMissingRemoteRefGitError } from './fetch-error-classification'
describe('isMissingRemoteRefGitError', () => {
it('matches missing remote ref messages', () => {
expect(
isMissingRemoteRefGitError(
new Error('fatal: could not find remote ref refs/heads/feature/test')
)
).toBe(true)
expect(
isMissingRemoteRefGitError(
new Error("fatal: couldn't find remote ref refs/heads/feature/test")
)
).toBe(true)
})
it('does not match auth or network failures', () => {
expect(isMissingRemoteRefGitError(new Error('fatal: Authentication failed'))).toBe(false)
expect(
isMissingRemoteRefGitError(new Error('fatal: unable to access repo: Could not resolve host'))
).toBe(false)
})
})