Documentation
¶
Overview ¶
Package gitops provides Git operations via subprocess.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommitAndPush ¶
CommitAndPush stages files, commits, and force-pushes to origin. The branch always represents HEAD + the YAML changes, so force push is the default.
func GetDefaultBranch ¶
func GetDefaultBranch() string
GetDefaultBranch returns the default branch name.
func PrepareWorktree ¶ added in v0.3.8
PrepareWorktree fetches origin/<base> and resets the working tree to a fresh <branch> based on it.
It must run BEFORE any YAML edits: at that point the working tree is clean, so switching away from whatever ref the caller checked out (e.g. a release tag on a diverged hotfix branch) never hits "local changes would be overwritten". Editing afterwards then makes the changes — and the resulting commit/PR — relative to origin/<base>, independent of the caller's checkout. When <branch> equals <base>, this simply checks out the up-to-date base for a direct commit.
Types ¶
This section is empty.