git

package
v0.14.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2026 License: MIT Imports: 7 Imported by: 0

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

func GetRepoState(dir string) (RepoState, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL