pub fn select_roots(
context: &GitContext,
source_root: &Path,
excluded_roots: &[PathBuf],
selection: &CopySelection,
) -> Result<Vec<String>, WorktreeCopyError>Expand description
What: The collapsed repository paths one copy takes from a source under the chosen selection. Why: Staging asks one question whichever source it copies from, so the selection mode is decided in one place.
In TS you’d write (pseudocode):
const roots = selection.kind === 'ignored' ? await readIgnoredRoots(...) : await readNamedIgnoredRoots(...);