Skip to main content

tracked

Function tracked 

Source
pub fn tracked(root: &Path) -> Result<Vec<PathBuf>>
Expand description

Every path git tracks under root, relative to root itself.

The list comes from the index instead of a directory walk. Build output, vendored trees, and anything else gitignored is not part of what this repo publishes.

The index contains paths from the working tree. root is a project inside it (one repository may contain several), so anything outside root is not this project’s. What is left is rebased onto root.

A tree with no repository tracks nothing (it cannot serve a file by tag). A repository whose index cannot be read is an error, never an empty answer.

§Errors

Returns an error when the repository’s index cannot be read.