def pin.of
import ezx@1.11.0.0/src/ws/joint.bend as Jointimport Base
import ezx@1.11.0.0/src/ledger/manifest.bend as M
261# the first git source among the dependencies with this url, as the root
262# reads it, or a hub source when there is none
263def pin.of(ds: List<&2, M.Dep>, +url: String) -> M.Source:
264 match ds:
265 case []:
266 M.Hub{""}
267 case M.Dep{_n, _h, _e, +src} <> tl:
268 rest = pin.of(tl, url)
269 pin.at(String.eq(M.source.url(src), url), src, rest)