Documentation
¶
Overview ¶
Package git provides utilities for detecting git worktree information.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DetectInfo ¶
type DetectInfo struct {
GitRoot string // Worktree root from: git rev-parse --show-toplevel
GitCommonDir string // Shared .git directory (absolute): git rev-parse --git-common-dir
IsWorktree bool // true if this is a linked worktree (not the main one)
MainWorktree string // Path to main worktree (parent of GitCommonDir)
WorktreeID string // Stable ID: hex(sha256(GitCommonDir))[:12]
}
DetectInfo holds git worktree detection results.
func Detect ¶
func Detect(path string) (*DetectInfo, error)
Detect detects git worktree information for the given path. Returns an error if git is not installed or path is not a git repository.
Click to show internal directories.
Click to hide internal directories.