Git.named: def of ezx@1.11.0.0 Import: import ezx@1.11.0.0/src/git/git.bend as Git Lines 135-144 of ezx@1.11.0.0/src/git/git.bend: https://jend.leeeet.dev/read.txt?path=ezx@1.11.0.0/src/git/git.bend&start_line=135&end_line=144 import Base # the commit of the first row whose ref name is exactly `want`, or "" when no # row is. The whole name is compared: `git ls-remote` matches its patterns # against the tail of a ref, so it answers `refs/heads/main` with # `refs/heads/feature/main` as well, and only this comparison tells them apart. def named(rs: List<&2, Row>, +want: String) -> String: match rs: case []: "" case +h <> t: named.step(String.eq(row.name(h), want), row.rev(h), _u => named(t, want)) Uses (7): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.eq https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/git/git.bend&name=Row https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/git/git.bend&name=named.step https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/git/git.bend&name=row.name https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/git/git.bend&name=row.rev