def tree.how
import ezx@1.11.0.0/src/doctor/plan.bend as Planimport Base
import ezx@1.11.0.0/src/lock/world.bend as W
import ezx@1.11.0.0/src/lock/lock.bend as L
525# how a tree read from BEND_LIB arrived, as the lock judges it. A git
526# package's tree under BEND_LIB is one `ez lock` reads from there too. A hub
527# package's is one `ez lock` would have the hub serve: its name is the digest
528# of its manifest and each file is checked against its sum, so bytes that pass
529# are the bytes the hub serves under that name, and bytes that do not are
530# refused either way.
531def tree.how(src: L.Src) -> W.How:
532 match src:
533 case L.Hub{}:
534 W.Served{}
535 case L.Git{_url, _rev, _entry, _root, _nar, _tag}:
536 W.Lib{}
537 case L.Member{_path, _entry}:
538 W.Lib{}