Expand description
Git-compatible path normalization and helpers for test-tool path-utils.
Logic matches git/path.c (normalize_path_copy, longest_ancestor_length,
relative_path, strip_path_suffix) and git/remote.c (relative_url).
Enums§
- GitPath
Error - Errors returned by Git-compatible path helper routines.
Functions§
- abspath_
part_ inside_ repo - Git
setup.cabspath_part_inside_repo(POSIX). - is_
absolute_ path_ unix - Whether
pathis an absolute Unix-style path. - longest_
ancestor_ length - Git’s
longest_ancestor_length- normalizespathand each colon-separated prefix. - normalize_
path_ copy - Purely textual path normalization matching Git’s
normalize_path_copy. ReturnsGitPathError::EscapesRootwhen..would escape above the root (Git returns -1). - prefix_
path_ gently - Git
setup.cprefix_path_gently(POSIX). - real_
path_ resolving - Like Git’s
strbuf_realpath/test-tool path-utils real_path: resolve symlinks by walking path components (so symlink targets are interpreted at each step), then if the leaf is missing, resolve the longest existing prefix and append the remainder. - relative_
path - Git’s
relative_pathfrompath.c(POSIX subset). - relative_
url - Git’s
relative_urlfromremote.c(POSIX; no DOS drive handling). - strip_
path_ suffix - Git’s
stripped_path_suffix_offset/strip_path_suffix.