Function targets_from_disk

Source
pub fn targets_from_disk(
    output_snd: &XvcOutputSender,
    xvc_root: &XvcRoot,
    current_dir: &AbsolutePath,
    targets: &Option<Vec<String>>,
    filter_git_paths: bool,
) -> Result<XvcPathMetadataMap>
Expand description

Converts targets to a map of XvcPaths and their metadata. It walks the file system with all_paths_and_metadata. This is aimed towards xvc file track, xvc file hash and similar commands where we work with the existing files.

This walks all the repository. It doesn’t try to optimize the walk by selecting targets first, because,

  • This is a premature optimization.
  • We need to consider ignore files and this requires to start a walk from the root.

If some day we need to optimize first walking the ignores, then walking the directories in the targets, I’d be glad that this is used in very large repositories.