Documentation
¶
Overview ¶
Package git provides functions for determining changes in a git repository.
Index ¶
- Variables
- func AssertGitStatusClean(ctx context.Context, git string) error
- func CheckRemoteURL(ctx context.Context, gitExe, remote string) error
- func CheckVersion(ctx context.Context, gitExe string) error
- func FilesChangedSince(ctx context.Context, ref, gitExe string, ignoredChanges []string) ([]string, error)
- func FindCommitsForPath(ctx context.Context, gitExe, path string) ([]string, error)
- func GetLastTag(ctx context.Context, gitExe, remote, branch string) (string, error)
- func IsNewFile(ctx context.Context, gitExe, ref, name string) bool
- func MatchesBranchPoint(ctx context.Context, gitExe, remote, branch string) error
- func ShowFileAtRemoteBranch(ctx context.Context, gitExe, remote, branch, path string) (string, error)
- func ShowFileAtRevision(ctx context.Context, gitExe, revision, path string) (string, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrGitStatusUnclean reported when the git status reports uncommitted // changes. ErrGitStatusUnclean = errors.New("git working directory is not clean") )
Functions ¶
func AssertGitStatusClean ¶
AssertGitStatusClean returns an error if the git working directory has uncommitted changes.
func CheckRemoteURL ¶
CheckRemoteURL checks that the git remote URL exists.
func CheckVersion ¶
CheckVersion checks that the git version command can run.
func FilesChangedSince ¶
func FilesChangedSince(ctx context.Context, ref, gitExe string, ignoredChanges []string) ([]string, error)
FilesChangedSince returns the files changed since the given git ref.
func FindCommitsForPath ¶
FindCommitsForPath returns the full hashes of all commits affecting the given path. The commits are returned in normal log order, i.e. latest commit first.
func GetLastTag ¶
GetLastTag returns the last git tag for the given release configuration.
func MatchesBranchPoint ¶
MatchesBranchPoint returns an error if the local repository has unpushed changes.
Types ¶
This section is empty.