Skip to main content

Module worktree

Module worktree 

Source
Expand description

comindly’s own checkout of each repository’s default branch: a detached git worktree under ~/.cache/comindly/worktrees, so indexing never touches your working folder or branches. Uses the git command, so your SSH keys and credential helpers apply.

Structs§

Auth
An HTTPS username and access token, handed to git for one command only.
Checkout
A checkout ready to index.
NeedsToken
Returned when an HTTPS remote needs a token that neither git’s credential helper nor the environment has.
NoCredentials
No tokens: git’s credential helper and SSH keys only.

Traits§

Credentials
Access tokens for HTTPS remotes by host; without one, git’s own credential helper answers.

Functions§

approve
Hand a token that worked to your git credential helper, as git does after a successful login.
auth_for
A token for cloning or fetching url without asking.
checkout_dir
comindly’s checkout of repo’s default branch under cache, if one has been made.
current_branch
The branch checked out in your own folder (for display).
default_branch
The branch to index: origin’s default (from origin/HEAD), else main or master.
ensure_clone
Clone url into parent/<name> with your git credentials; returns the new folder. comindly’s own copy of url at dest: cloned once, without a checkout (indexing uses its worktree) and without file contents until needed; later runs only fetch.
helper_auth
What your git credential helper holds for host.
name
The repository’s name: its folder’s name.
prepare
Fetch the remote’s default branch and check it out in comindly’s worktree, detached, so your folder and branches are never touched. Offline, the last known default branch is used.
remote_default
The remote’s default branch and its commit, asked from the remote; also records it as origin/HEAD.
remote_head
The default branch and its commit of the repository at url, without a local clone.
remote_url
remove
Remove comindly’s worktree for repo (your folder is untouched).
scan
Git repositories under dir, up to depth levels down (not inside other repositories).
token_user
The username a host expects with an access token.