gleamunison/branch_scope
Read-only questions that span branches: which branches this store knows, and which of them bind a given piece of content.
The name layer answers branch-local questions (namespace.gleam owns the pointers and the commit); this module is the read model over all of them. It exists because content is shared and names are not: a retraction scoped to one namespace cannot see that another branch still resolves to the ref, so it would delete bytes a different branch still loads.
Branch pointers are the registry. Each is a chunk keyed by its branch name whose bytes carry that name back, so a scan of the store recovers the set without a second index to keep in sync.
Values
pub fn branches(
adapter: storage.StorageAdapter,
) -> Result(List(String), String)
Every branch this store knows about, sorted.
pub fn branches_binding(
adapter: storage.StorageAdapter,
ref: identity.DefinitionRef,
) -> Result(List(#(String, String)), String)
Every (branch, name) pair that binds this content, across all branches.