def default.ref
import ezx@1.11.0.0/src/add/plan.bend as Planimport Base
import ezx@1.11.0.0/src/add/world.bend as A
import ezx@1.11.0.0/src/git/git.bend as Git
108# the ref `ez add` pins when none was asked for: the tag `Git.choose` takes
109# from every tag on the remote, the greatest release, else the greatest
110# pre-release; else the branch HEAD's symref names (EZ-RES-1)
111def default.ref(+world: A.World) -> String:
112 +chosen = Git.choose(Git.tag.names(rows(world, QTags{})))
113 Bool.pick(String, String.is_empty(chosen), Git.tip.branch(rows(world, QHead{})), chosen)