Skip to main content

Module git

Module git 

Source
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.
BranchRef
Reference to a branch for parallel task execution.
CompletionBranch
Branch information for shell completions
FailedCommand
Information about a failed command, for display in error messages.
GitRemoteUrl
Parsed git remote URL with host, owner (namespace), and repository components.
HookErrorWithHint
Wrapper that displays a HookCommandFailed error with the –no-verify hint. Created by add_hook_skip_hint() for commands that support --no-verify.
HookTypeIter
An iterator over the variants of HookType
IntegrationSignals
Integration signals for checking if a branch is integrated into target.
LineDiff
Line-level diff totals (added/deleted counts) used across git operations.
Repository
Repository state for git operations.
SwitchSuggestionCtx
Extra CLI context for enriching wt switch suggestions in error hints.
WorkingTree
A borrowed handle for running git commands in a specific worktree.
WorktreeInfo
Parsed worktree data from git worktree list --porcelain.

Enums§

BranchCategory
Category of branch for completion display
GitError
Domain errors for git and worktree operations.
HookType
Hook types for git operations
IntegrationReason
Why branch content is considered integrated into the target branch.
RefType
Platform-specific reference type (PR vs MR).
ResolvedWorktree
Result of resolving a worktree name.
WorktrunkError
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 HEAD on 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 -z output 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 -z output.
path_dir_name
Extract the directory name from a path for display purposes.
set_base_path
Initialize the global base path for repository operations.