Documentation
¶
Index ¶
- Variables
- func ActiveReleaseBranches() []string
- func AllLocalBranches() []string
- func BranchCommitSubjects(parentBranch, branchName string) []string
- func BranchExists(name string) bool
- func BranchMergeCommitSubjects(parentBranch, branchName string) []string
- func BranchTypeOf(name string) string
- func CurrentBranch() string
- func Exec(args ...string) error
- func ExecLines(args ...string) []string
- func ExecQuiet(args ...string) string
- func ExecResult(args ...string) (int, string, string)
- func ExecSilent(args ...string) error
- func FlowVersion(version string) string
- func HasStagedChanges() bool
- func HasUncommittedChanges() bool
- func IsGitFlowInitialized() bool
- func IsGitRepo() bool
- func LatestTag() string
- func RemoteExists(name string) bool
- func Remotes() []string
- func RemovePrefix(s, prefix string) string
- func Run(cmdStr string) error
- func RunLines(cmdStr string) []string
- func RunQuiet(cmdStr string) string
- func RunResult(cmdStr string) (int, string, string)
- func SetDefaultClient(c GitClient)
- func SplitCommand(s string) []string
- func StashPop() error
- func StashSave(msg string) error
- func TagExists(tag string) bool
- type GitClient
- type LocalGitClient
- type WorkTreeStatus
Constants ¶
This section is empty.
Variables ¶
var ProjectRoot string
ProjectRoot is the working directory for all git commands. Deprecated: will be removed once all callers migrate to GitClient.
Functions ¶
func ActiveReleaseBranches ¶
func ActiveReleaseBranches() []string
func AllLocalBranches ¶
func AllLocalBranches() []string
func BranchCommitSubjects ¶
BranchCommitSubjects returns the commit message subjects (first line) for commits reachable from branchName but not from parentBranch, excluding merge commits. These are the work-commits that will land in the parent on finish.
func BranchExists ¶
func BranchMergeCommitSubjects ¶
BranchMergeCommitSubjects returns merge-commit subjects for commits reachable from branchName but not from parentBranch. A non-zero result means the branch has sync merges that could be rebased away for a cleaner graph before finishing.
func BranchTypeOf ¶
BranchTypeOf delegates to branch.TypeOf for backward compatibility.
func CurrentBranch ¶
func CurrentBranch() string
func Exec ¶
Exec runs git with explicit arguments (no shell interpretation). This is the safe replacement for Run() that prevents shell injection.
func ExecResult ¶
ExecResult runs git with explicit arguments and captures output.
func ExecSilent ¶
ExecSilent runs git without logging the command or printing any output. Use for internal plumbing (init, branch creation, commits) where verbose output would pollute the user-facing progress display.
func FlowVersion ¶
func HasStagedChanges ¶
func HasStagedChanges() bool
func HasUncommittedChanges ¶
func HasUncommittedChanges() bool
func IsGitFlowInitialized ¶
func IsGitFlowInitialized() bool
func RemoteExists ¶
func RemovePrefix ¶
func SetDefaultClient ¶
func SetDefaultClient(c GitClient)
SetDefaultClient replaces the package default client (useful for tests).
func SplitCommand ¶
SplitCommand is an exported wrapper around splitCommand. Use this when callers need to convert a single command string into args suitable for exec.Command without invoking a shell. This helps migrate callers away from legacy Run()/RunResult() wrappers.
Types ¶
type GitClient ¶
type GitClient interface {
Exec(args ...string) error
ExecResult(args ...string) (int, string, string)
ExecQuiet(args ...string) string
ExecLines(args ...string) []string
}
GitClient abstracts git command execution for easier testing and migration away from package-level globals.
func DefaultClient ¶
func DefaultClient() GitClient
DefaultClient returns the current default GitClient. When no override is set, a dynamic client is returned so the effective working directory follows mutations to `git.ProjectRoot` (important for tests).
type LocalGitClient ¶
type LocalGitClient struct {
Root string
}
LocalGitClient runs git commands in a specific working directory.
func NewLocalGitClient ¶
func NewLocalGitClient(root string) *LocalGitClient
NewLocalGitClient creates a LocalGitClient bound to the provided root.
func (*LocalGitClient) Exec ¶
func (c *LocalGitClient) Exec(args ...string) error
func (*LocalGitClient) ExecLines ¶
func (c *LocalGitClient) ExecLines(args ...string) []string
func (*LocalGitClient) ExecQuiet ¶
func (c *LocalGitClient) ExecQuiet(args ...string) string
func (*LocalGitClient) ExecResult ¶
func (c *LocalGitClient) ExecResult(args ...string) (int, string, string)
type WorkTreeStatus ¶
func WorkingTreeStatus ¶
func WorkingTreeStatus() WorkTreeStatus