Skip to main content

repository_hash_from_path

Function repository_hash_from_path 

Source
pub fn repository_hash_from_path(path: &Path) -> Option<RepositoryHash>
Expand description

Calculate repository hash from a directory path for git worktree support.

Returns Some(RepositoryHash) if the path is inside a git repository. The hash is computed from the git common directory (shared .git), so all worktrees of the same repository return the same hash. Returns None for non-git directories.