Skip to main content

choose

Function choose 

Source
pub fn choose(
    git: &Git,
    worktrees: &[Worktree],
    destination: &Path,
    target_commit: &str,
) -> Option<PathBuf>
Expand description

Chooses the checkout to clone from, or None when none can serve.

Only worktrees of the same repository on the same device qualify, because a block clone cannot cross volumes. Among those, the one whose HEAD differs from the target commit in the fewest paths wins, since every differing path is one git has to write.