Documentation
¶
Index ¶
- Variables
- func ChangedFilesFromBase(repoPath, baseBranch string) ([]string, error)
- func CurrentCommit(path string) (string, error)
- func DefaultBranch(repoPath string) (string, error)
- func EnsureGivenPatternIsInGitignore(fs afero.Fs, repoRoot string, pattern string) (err error)
- type Repo
- type RepoFinder
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoGitRepoFound = errors.New("no git repository found")
)
Functions ¶
func ChangedFilesFromBase ¶ added in v0.11.505
ChangedFilesFromBase returns the list of file paths (relative to the repo root) that have changed between the merge base of the given base branch and HEAD.
func CurrentCommit ¶ added in v0.11.152
func DefaultBranch ¶ added in v0.11.505
DefaultBranch returns the default branch name for the repository at the given path. It tries to detect it from the remote HEAD, falling back to checking if "main" or "master" exist.
Types ¶
type Repo ¶
type Repo struct {
Path string `json:"path"`
}
Repo represents the path of a given git repository.
func FindRepoFromPath ¶
func FindRepoInSubtree ¶ added in v0.11.195
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.
Click to show internal directories.
Click to hide internal directories.