git

package
v0.11.273 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoGitRepoFound = errors.New("no git repository found")
)

Functions

func CurrentCommit added in v0.11.152

func CurrentCommit(path string) (string, error)

func EnsureGivenPatternIsInGitignore

func EnsureGivenPatternIsInGitignore(fs afero.Fs, repoRoot string, pattern string) (err error)

Types

type Repo

type Repo struct {
	Path string `json:"path"`
}

Repo represents the path of a given git repository.

func FindRepoFromPath

func FindRepoFromPath(path string) (*Repo, error)

func FindRepoInSubtree added in v0.11.195

func FindRepoInSubtree(root string) (*Repo, error)

FindRepoInSubtree finds the git repository in the subtree specified by path. In contrast to FindRepoFromPath, this functions decends down into a directory, and returns the first repository it finds.

type RepoFinder

type RepoFinder struct{}

RepoFinder is a wrapper for finding the root path of a git repository.

func (*RepoFinder) Repo

func (*RepoFinder) Repo(path string) (*Repo, error)

Repo uses git by spawning a process to locate the top level directory.

Jump to

Keyboard shortcuts

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