Skip to main content

Crate repo_path_lib

Crate repo_path_lib 

Source
Expand description

§repo_path_lib

Get the path for the root of the Git repository.

let repo_root = repo_path_lib::repo_dir();

This library is intended for library authors that want to access the repository root of their users.
If you want to access paths in your own repository (e.g. in your own CI code), take a look at the repo_path crate instead.

§How it works

This crate looks for a .git/ directory in the current working directory or any of its parents.
The directory that contains the .git/ directory is considered the root of the repository.

This path is cached in memory to avoid recalculating it throughout the runtime of your code.

Modules§

error
Error types for repo_path_lib.

Functions§

determine_repo_dir_for_path
Provide the absolute path to the repository root directory above the provided start path.
repo_dir
Provide the absolute path to the repository root directory above the current working directory.