Expand description
Git operations and repository management
Re-exports§
pub use recover::current_or_recover;pub use recover::cwd_removed_hint;
Modules§
- recover
- Recovery from a deleted current working directory.
- remote_
ref - Unified PR/MR reference resolution.
Structs§
- Branch
- A handle for running git commands on a specific branch.
- Branch
Ref - Reference to a branch for parallel task execution.
- Completion
Branch - Branch information for shell completions
- Failed
Command - Information about a failed command, for display in error messages.
- GitRemote
Url - Parsed git remote URL with host, owner (namespace), and repository components.
- Hook
Error With Hint - Wrapper that displays a HookCommandFailed error with the –no-verify hint.
Created by
add_hook_skip_hint()for commands that support--no-verify. - Hook
Type Iter - An iterator over the variants of HookType
- Integration
Signals - Integration signals for checking if a branch is integrated into target.
- Line
Diff - Line-level diff totals (added/deleted counts) used across git operations.
- Repository
- Repository state for git operations.
- Switch
Suggestion Ctx - Extra CLI context for enriching
wt switchsuggestions in error hints. - Working
Tree - A borrowed handle for running git commands in a specific worktree.
- Worktree
Info - Parsed worktree data from
git worktree list --porcelain.
Enums§
- Branch
Category - Category of branch for completion display
- GitError
- Domain errors for git and worktree operations.
- Hook
Type - Hook types for git operations
- Integration
Reason - Why branch content is considered integrated into the target branch.
- RefType
- Platform-specific reference type (PR vs MR).
- Resolved
Worktree - Result of resolving a worktree name.
- Worktrunk
Error - Semantic errors that require special handling in main.rs
Constants§
- NULL_
OID - The null OID returned by git when no commits exist (e.g.,
git rev-parse HEADon an unborn branch).
Traits§
- RefContext
- Common display fields for PR/MR context.
Functions§
- add_
hook_ skip_ hint - If the error is a HookCommandFailed, wrap it to add a hint about using –no-verify.
- branch_
tracks_ ref - Check if a local branch is tracking a specific remote ref.
- check_
integration - Canonical integration check using pre-computed signals.
- compute_
integration_ lazy - Compute integration signals lazily with short-circuit evaluation.
- exit_
code - Extract exit code from WorktrunkError, if applicable
- parse_
numstat_ line - Parse a git numstat line and extract insertions/deletions.
- parse_
owner_ repo - Extract owner and repository name from a git remote URL.
- parse_
porcelain_ z - Parse
git status --porcelain -zoutput into a list of affected filenames. - parse_
remote_ owner - Extract owner from a git remote URL.
- parse_
untracked_ files - Parse untracked files from
git status --porcelain -zoutput. - path_
dir_ name - Extract the directory name from a path for display purposes.
- set_
base_ path - Initialize the global base path for repository operations.