ProfileFetchPolicy typedef

ProfileFetchPolicy = bool Function(ProfileFetch fetch)

Whether a resolution may make fetch, asked just before it runs. A chain reaches each parent's source only once the child's package is read, so a plan asks about every source it reaches, including a parent in another repository that the configuration never names. Answer from what the person already approved: the source's mirror stays locked while the policy runs, so it must not wait for them. A refused fetch throws ProfileFetchRequiredException; ask then, and plan again.

It is all a host needs for per-source consent. Every Git command a resolution runs that can reach the network, a mirror's clone or its remote update --prune origin, follows the policy's yes for that command's ProfileFetch.location, which is the URL or path Git reaches. The refresh names origin, the remote the clone stored for that location, so another remote on the mirror is not contacted. Every other command reads a mirror already in the cache. Compare the location with WayfinderProfileSource.locationOf of each source the person approved.

Implementation

typedef ProfileFetchPolicy = bool Function(ProfileFetch fetch);