Skip to main content

assert_safe_repository_path

Function assert_safe_repository_path 

Source
pub fn assert_safe_repository_path(
    repository_path: &str,
) -> Result<(), WorktreeCopyError>
Expand description

What: Validates one slash-separated path that Git reported before it is joined to a filesystem root. Why: An empty, absolute, . or .. component could select a path outside the worktree.

In TS you’d write (pseudocode):

function assertSafeRepositoryPath(repositoryPath: string): void;