Skip to main content

staged_contents

Function staged_contents 

Source
pub async fn staged_contents(
    root: &Path,
    wanted: fn(&Path) -> bool,
) -> Result<Vec<(PathBuf, Result<String>)>, GitError>
Expand description

Each staged file wanted accepts, with the content the commit records for it.

The content comes from the same index as the list, never from the working tree, which differs from it after a partial git add and under an index the committer chose. A file whose content cannot be read carries its error, as reading it from disk would.