Function
fetchDiff
(
deps: Types.GitDeps,
mode: Types.BaseMode,
)
Source from the content-addressed store, hash-verified
| 14 | * @returns the outcome |
| 15 | */ |
| 16 | export async function fetchDiff( |
| 17 | deps: Types.GitDeps, |
| 18 | mode: Types.BaseMode, |
| 19 | ): Promise<Types.FetchOutcome> { |
| 20 | const isBusy = await Probes.isTransient( |
| 21 | deps.entryKindsOf, |
| 22 | deps.repository.gitDir, |
| 23 | ) |
| 24 | |
| 25 | if (isBusy) { |
| 26 | return { kind: 'unavailable' } |
| 27 | } |
| 28 | |
| 29 | const context = Tiers.fetchContextOf(deps, mode) |
| 30 | const isBranch = mode === 'branch' |
| 31 | |
| 32 | return isBranch ? Tiers.branchTier(context) : Tiers.workingTreeTier(context) |
| 33 | } |
Tested by
no test coverage detected