def named
import ezx@1.11.0.0/src/git/git.bend as Gitimport Base
135# the commit of the first row whose ref name is exactly `want`, or "" when no
136# row is. The whole name is compared: `git ls-remote` matches its patterns
137# against the tail of a ref, so it answers `refs/heads/main` with
138# `refs/heads/feature/main` as well, and only this comparison tells them apart.
139def named(rs: List<&2, Row>, +want: String) -> String:
140 match rs:
141 case []:
142 ""
143 case +h <> t:
144 named.step(String.eq(row.name(h), want), row.rev(h), _u => named(t, want))