Git.root.rel: def of ezx@1.11.0.0 Import: import ezx@1.11.0.0/src/git/git.bend as Git Lines 237-243 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=237&end_line=243 import Base import ezx@1.11.0.0/src/pkg/path.bend as P # the directory inside the repo a package's paths are written from. `pkg/pkg` # resolves that against the checkout it read; the lock records it against the # repo, so the same number of components is climbed back off the entry's own # directory here. It is "." until a module reached through `..` re-roots the # package above the entry. def root.rel(+at: String, root: String, +entry: String) -> String: P.climb(Nat.sub(depth(P.dir(at)), depth(root)), P.dir(entry)) Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/git/git.bend&name=depth https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/pkg/path.bend&name=climb https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/pkg/path.bend&name=dir