Skip to main content

Module template

Module template 

Source
Expand description

Worktree-store path-template rendering (spec §6).

New worktrees are placed according to a configurable template with the variables {repo_parent}, {repo}, {repo_root}, {branch}, {branch_slug}, and {home}. render substitutes them; ensure_outside_git rejects a rendered path that would land inside the .git directory.

Structs§

TemplateVars
The values substituted into a path template. For a bare repository these resolve against the bare repo’s own directory (spec §6).

Constants§

DEFAULT_TEMPLATE
The default worktree-store template (spec §6 “Sibling”).

Functions§

ensure_outside_git
Rejects a rendered worktree path that lies inside the repository’s .git directory (spec §6).
render
Renders template, substituting the TemplateVars. An unknown {var} or an unterminated { is a configuration error.