Documentation
¶
Overview ¶
Package git provides utilities for inspecting Git repository state.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RepoStatus ¶
type RepoStatus struct {
// IsRepo indicates whether the path is inside a git repository.
IsRepo bool
// IsDirty indicates whether the working tree has uncommitted changes.
IsDirty bool
// Commit is the short SHA of the HEAD commit (empty if not a repo).
Commit string
}
RepoStatus describes the state of a Git repository at a given path.
func GetRepositoryStatus ¶
func GetRepositoryStatus(ctx context.Context, dir string) (*RepoStatus, error)
GetRepositoryStatus inspects the git repository at dir and returns its status. Returns a non-repo RepoStatus (IsRepo=false) if dir is not inside a git repository. Returns an error only for unexpected failures (not for "not a repo").
Click to show internal directories.
Click to hide internal directories.