Documentation
¶
Overview ¶
Package vcs provides Git version control operations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunGit ¶
RunGit runs a git command with the given arguments and returns the output. The directory is validated via validateDir to prevent directory traversal. Git is a trusted command and the args are controlled by the caller through specific API functions, preventing arbitrary command execution. #nosec G204 - Git is a trusted command with controlled arguments
Types ¶
type CommitResult ¶
CommitResult holds the result of a git commit.
type DiffInfo ¶
DiffInfo holds the git diff output.
func Diff ¶
Diff returns the differences between the working directory and the index (alias for GetDiff).
func DiffStaged ¶
DiffStaged returns the differences between the index and HEAD (alias for GetDiffStaged).
func GetDiffStaged ¶
GetDiffStaged returns the differences between the index and HEAD.
type StatusInfo ¶
StatusInfo holds the git status output.
func GetStatus ¶
func GetStatus(dir string) (*StatusInfo, error)
GetStatus returns the current git status.
func Status ¶
func Status(dir string) (*StatusInfo, error)
Status returns the current git status (alias for GetStatus).