Documentation
¶
Overview ¶
Package git is STABLE — local git repository workspace querying and status helpers. It is part of the stable operator path.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RepoState ¶
type RepoState struct {
IsRepo bool `json:"is_repo"`
Branch string `json:"branch,omitempty"`
Commit string `json:"commit,omitempty"`
Subject string `json:"subject,omitempty"`
IsDirty bool `json:"is_dirty"`
DirtyCount int `json:"dirty_count,omitempty"`
DirtyFiles []string `json:"dirty_files,omitempty"`
AheadCount int `json:"ahead_count,omitempty"`
BehindCount int `json:"behind_count,omitempty"`
}
RepoState captures key details of a local git repository.
func GetRepoState ¶
GetRepoState queries the git command line tool at the specified directory to collect repository metadata. If git is not installed or the directory is not inside a git repository, it returns a RepoState with IsRepo: false.
Click to show internal directories.
Click to hide internal directories.