Skip to main content

Module git

Module git 

Source

Functions§

branch_exists
Check if a branch already exists.
detect_capabilities
Build a GitCapabilities struct from a detected GitVersion.
detect_git_version
Run git --version, parse the result, and validate against minimum version. Returns GitCapabilities on success.
parse_git_version
Parse the output of git --version into a GitVersion.
parse_worktree_list_porcelain
Parse the porcelain output of git worktree list into WorktreeHandles.
post_create_git_crypt_check
Post-create git-crypt check on the new worktree path. Returns Ok(()) if the worktree is safe, Err(GitCryptLocked) if encrypted files detected.
resolve_ref
Resolve a ref to its 40-char SHA.
run_worktree_list
Run git worktree list --porcelain [-z] and parse the output.
worktree_add
Run git worktree add with the appropriate flags. Returns Ok(()) on success.
worktree_remove
Run git worktree remove <path> (non-force).
worktree_remove_force
Run git worktree remove --force <path>.