pathutil

package
v0.4.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package pathutil provides path and name validation utilities for JVS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanRel

func CleanRel(path string) (string, error)

CleanRel normalizes a component-relative path and rejects paths that escape their root. It treats ".." as a component, so names such as "a..b" remain valid.

func ValidateName

func ValidateName(name string) error

ValidateName checks worktree/ref name safety per spec 02/03.

func ValidateNoSymlinkParents

func ValidateNoSymlinkParents(root, rel string) error

ValidateNoSymlinkParents verifies that every existing parent component under root is a real directory. The final component is intentionally not checked so callers can treat a symlink leaf as data.

func ValidatePathSafety

func ValidatePathSafety(repoRoot, targetPath string) error

ValidatePathSafety verifies target path does not escape repo root.

func ValidateTag

func ValidateTag(tag string) error

ValidateTag validates a tag string (same rules as worktree names).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL