Skip to main content

list

Function list 

Source
pub fn list(index_path: &Path, hash: Kind) -> Result<Listed>
Expand description

Lists what the index records, without being told the paths in advance.

staged_ids answers about paths a caller already knows; status needs the other direction — “which declared paths would the next commit store, and as what” — and can only get there by enumerating. Both go through the one parser in this module, so there is never a second reading of the same bytes.

§Errors

Error::Io when the index exists but cannot be read. An index that does not exist yet is not an error: nothing is tracked, so the list is empty.