Skip to main content

Module ops

Module ops 

Source

Functions§

clone_or_fetch
Clone url into dest, or fetch all refs if the repo already exists.
create_worktree
Create a detached worktree at worktree_path pointing at ref_name.
destroy_worktree
Remove a worktree previously created with create_worktree.
get_sha
Resolve ref_name to its full SHA in repo.
list_commits
Return up to limit commits reachable from ref_name.
list_refs
Return all branches, tags, and recent commits for repo.
normalize_git_url
Convert a repository browse URL into a clonable git URL.
resolve_committish
Resolve a user-facing ref name to a concrete commit SHA the worktree/scan commands accept. A clone only materialises a local branch for the repository’s default branch; every other branch exists solely as a remote-tracking ref (refs/remotes/origin/<name>). Ref listing strips the origin/ prefix for display, so a bare branch name like “test” won’t resolve directly — we fall back to the remote-tracking form. Tags and raw SHAs resolve on the first candidate. Peeling with ^{commit} also dereferences annotated tags.