Documentation
¶
Overview ¶
Package gitinit is the one place Sidecar initializes a Git repository. Git status, Configuration's Add Project form, and first-run onboarding all call it rather than spawning `git init` themselves.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var SidecarGitignoreEntries = []string{
".todos/",
".sidecar/",
".sidecar-agent",
".sidecar-task",
".sidecar-pr",
".sidecar-start.sh",
".sidecar-base",
".td-root",
}
SidecarGitignoreEntries lists sidecar state paths that should be ignored when the user explicitly initializes a repository from Sidecar. Opening an existing repository never mutates its .gitignore.
Functions ¶
func EnsureGitignore ¶
EnsureGitignore appends missing entries to .gitignore in workDir.
func Init ¶
Init runs `git init -b main` in dir and ensures sidecar local-state paths are ignored. Root is set when git init succeeded. A non-nil error with a non-empty Root is a non-fatal .gitignore warning; an empty Root is fatal.
func IsRepository ¶
IsRepository reports whether dir is inside a Git work tree. It is meant for a tea.Cmd, not the render path: it spawns git.