Skip to main content

Module git

Module git 

Source

Structs§

CommandResult
Result of running a command, with stdout captured as String.

Functions§

branch_exists
Check if a branch exists.
canonicalize_or
Canonicalize a path, falling back to the original path on failure.
detect_default_branch
Auto-detect the repository’s default branch.
fetch_and_rebase_target
Fetch from remote and determine the rebase target for a base branch.
find_worktree_by_branch
Find worktree path by branch name.
find_worktree_by_intended_branch
Find worktree path by intended branch name (from metadata).
find_worktree_by_name
Find worktree by directory name.
get_branch_name_error
Get descriptive error message for invalid branch name.
get_config
Get a git config value (local scope).
get_current_branch
Get the current branch name.
get_feature_worktrees
Get feature worktrees, excluding main repo and detached entries.
get_main_repo_root
Get main repository path, even when called from a worktree.
get_pr_state
Query GitHub PR state for a branch using gh CLI.
get_repo_root
Get the root directory of the git repository.
git_command
Run a git command.
has_command
Check if a command is available in PATH.
is_branch_merged
Check if a branch has been merged into the base branch.
is_non_interactive
Check if running in non-interactive environment.
is_valid_branch_name
Check if a branch name is valid according to git rules.
normalize_branch_name
Normalize branch name by removing refs/heads/ prefix if present.
parse_worktrees
Parse git worktree list --porcelain output.
remote_branch_exists
Check if a branch exists on a remote.
remove_worktree_safe
Remove a git worktree with platform-safe fallback.
run_command
Run a shell command.
set_config
Set a git config value (local scope).
unset_config
Unset a git config value.

Type Aliases§

WorktreeEntry
Parsed worktree entry: (branch_or_detached, path).