Skip to main content

detect

Function detect 

Source
pub fn detect(start: &Path) -> Option<Located>
Expand description

Walk up from start to the filesystem root looking for a repository. A .jj directory wins over .git (colocated repos are driven through jj); .git may be a directory or a gitlink file (a linked worktree/submodule). Pure filesystem probing — no subprocess.

start is walked exactly as given via Path::parent, so pass an absolute path to search ancestors — a relative path like "." has no ancestor chain and only its own directory is checked. (Repo::open absolutises for you.)