fix(git): cache unsupported capabilities per host (#8109)
* fix(git): cache unsupported capabilities per host Old Git worktree, ref-search, and merge-tree fallbacks retried unsupported flags on recurring operations, flooding subprocess traces. Centralize capability probing per native, WSL, and SSH execution host, coalesce concurrent probes, and retry periodically for in-place Git upgrades. * fix(git): recognize real old-Git merge-tree rejection * test(git): enforce real binary compatibility matrix * fix(ci): preserve Git compatibility test ownership * fix(git): retain supported capability state
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import { beforeEach, describe, expect, it } from 'vitest'
|
||||
import {
|
||||
clearGitCapabilityStateForTests,
|
||||
getLocalGitCapabilityCache,
|
||||
getSshGitCapabilityCache
|
||||
} from './git-capability-state'
|
||||
|
||||
describe('Git capability execution-host state', () => {
|
||||
beforeEach(() => {
|
||||
clearGitCapabilityStateForTests()
|
||||
})
|
||||
|
||||
it('shares native state while isolating each WSL distro', () => {
|
||||
expect(getLocalGitCapabilityCache({ cwd: '/repo-a' })).toBe(
|
||||
getLocalGitCapabilityCache({ cwd: '/repo-b' })
|
||||
)
|
||||
expect(getLocalGitCapabilityCache({ wslDistro: 'Ubuntu' })).toBe(
|
||||
getLocalGitCapabilityCache({ cwd: '\\\\wsl.localhost\\Ubuntu\\home\\repo' })
|
||||
)
|
||||
expect(getLocalGitCapabilityCache({ wslDistro: 'Ubuntu' })).not.toBe(
|
||||
getLocalGitCapabilityCache({ wslDistro: 'Debian' })
|
||||
)
|
||||
expect(getLocalGitCapabilityCache()).not.toBe(
|
||||
getLocalGitCapabilityCache({ wslDistro: 'Ubuntu' })
|
||||
)
|
||||
})
|
||||
|
||||
it('shares one SSH provider lifetime without leaking into a replacement provider', () => {
|
||||
const provider = {}
|
||||
const replacementProvider = {}
|
||||
|
||||
expect(getSshGitCapabilityCache(provider)).toBe(getSshGitCapabilityCache(provider))
|
||||
expect(getSshGitCapabilityCache(provider)).not.toBe(
|
||||
getSshGitCapabilityCache(replacementProvider)
|
||||
)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user