Documentation ¶
Overview ¶
Package validate provides functionality to validate the status of Git repositories. These validators are used mostly inside Cobra commands.
Index ¶
- func EnterMainBranch(backend *git.BackendCommands) (string, error)
- func EnterParent(branch, defaultParent string, backend *git.BackendCommands) (string, error)
- func EnterPerennialBranches(backend *git.BackendCommands, mainBranch string) error
- func HandleUnfinishedState(run *git.ProdRunner, connector hosting.Connector) (quit bool, err error)
- func HasGitVersion(backend *git.BackendCommands) error
- func IsAcceptableGitVersion(major, minor int) bool
- func IsConfigured(backend *git.BackendCommands) error
- func IsOnline(config *git.RepoConfig) error
- func IsRepository(run *git.ProdRunner) error
- func KnowsBranchAncestry(branch, defaultBranch string, backend *git.BackendCommands) (err error)
- func KnowsBranchesAncestry(branches []string, backend *git.BackendCommands) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnterMainBranch ¶
func EnterMainBranch(backend *git.BackendCommands) (string, error)
EnterMainBranch lets the user select a new main branch for this repo. This includes asking the user and updating the respective setting.
func EnterParent ¶
func EnterParent(branch, defaultParent string, backend *git.BackendCommands) (string, error)
EnterParent lets the user select a new parent for the given branch.
func EnterPerennialBranches ¶
func EnterPerennialBranches(backend *git.BackendCommands, mainBranch string) error
EnterPerennialBranches lets the user update the perennial branches. This includes asking the user and updating the respective settings based on the user selection.
func HandleUnfinishedState ¶
HandleUnfinishedState checks for unfinished state on disk, handles it, and signals whether to continue execution of the originally intended steps.
func HasGitVersion ¶
func HasGitVersion(backend *git.BackendCommands) error
HasGitVersion verifies that the system has Git of version 2.7 or newer installed.
func IsAcceptableGitVersion ¶
IsAcceptableGitVersion indicates whether the given Git version works for Git Town.
func IsConfigured ¶
func IsConfigured(backend *git.BackendCommands) error
IsConfigured verifies that the given Git repo contains necessary Git Town configuration.
func IsOnline ¶
func IsOnline(config *git.RepoConfig) error
IsOnline verifies that the given Git repository is online.
func IsRepository ¶
func IsRepository(run *git.ProdRunner) error
IsRepository verifies that the given folder contains a Git repository. It also navigates to the root directory of that repository.
func KnowsBranchAncestry ¶
func KnowsBranchAncestry(branch, defaultBranch string, backend *git.BackendCommands) (err error)
KnowsBranchAncestry prompts the user for all unknown ancestors of the given branch.
func KnowsBranchesAncestry ¶
func KnowsBranchesAncestry(branches []string, backend *git.BackendCommands) error
KnowsBranchesAncestry asserts that the entire ancestry for all given branches is known to Git Town. Missing ancestry information is queried from the user.
Types ¶
This section is empty.