Skip to main content

copy_untracked

Function copy_untracked 

Source
pub fn copy_untracked(
    from_path: &Path,
    to_path: &Path,
    options: CopyOptions<'_>,
) -> Result<Vec<PathBuf>>
Expand description

Copy only untracked (and optionally ignored) files from source to destination.

Uses ignore::WalkBuilder to walk from_path, skipping gitignored paths by default (so node_modules/, target/, etc. are never entered). With include_ignored, gitignore filtering is disabled and all files are visited. In both cases, tracked files are filtered out via an O(1) git index lookup.