Documentation ¶
Overview ¶
Package validate provides functionality to validate the status of Git repositories. These validators are used mostly inside Cobra commands.
Index ¶
- func HandleUnfinishedState(args UnfinishedStateArgs) (quit bool, err error)
- func HasAcceptableGitVersion(majorVersion, minorVersion int) error
- func IsAcceptableGitVersion(major, minor int) bool
- func IsConfigured(backend *git.BackendCommands, config *config.Config, ...) error
- func KnowsBranchesAncestors(args KnowsBranchesAncestorsArgs) (bool, error)
- func NoOpenChanges(hasOpenChanges bool) error
- type KnowsBranchesAncestorsArgs
- type UnfinishedStateArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleUnfinishedState ¶
func HandleUnfinishedState(args UnfinishedStateArgs) (quit bool, err error)
HandleUnfinishedState checks for unfinished state on disk, handles it, and signals whether to continue execution of the originally intended steps.
func HasAcceptableGitVersion ¶
HasAcceptableGitVersion 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, config *config.Config, localBranches gitdomain.LocalBranchNames, dialogInputs *components.TestInputs) error
IsConfigured verifies that the given Git repo contains necessary Git Town configuration.
func KnowsBranchesAncestors ¶
func KnowsBranchesAncestors(args KnowsBranchesAncestorsArgs) (bool, error)
KnowsBranchesAncestors asserts that the entire lineage for all given branches is known to Git Town. Prompts missing lineage information from the user. Indicates if the user made any changes to the ancestry.
func NoOpenChanges ¶
Types ¶
type KnowsBranchesAncestorsArgs ¶
type KnowsBranchesAncestorsArgs struct { Backend *git.BackendCommands BranchesToVerify gitdomain.LocalBranchNames Config *config.Config DefaultChoice gitdomain.LocalBranchName DialogTestInputs *components.TestInputs LocalBranches gitdomain.BranchInfos MainBranch gitdomain.LocalBranchName }
type UnfinishedStateArgs ¶
type UnfinishedStateArgs struct { Connector hostingdomain.Connector CurrentBranch gitdomain.LocalBranchName DialogTestInputs components.TestInputs HasOpenChanges bool InitialBranchesSnapshot gitdomain.BranchesSnapshot InitialConfigSnapshot undoconfig.ConfigSnapshot InitialStashSize gitdomain.StashSize Lineage configdomain.Lineage PushHook configdomain.PushHook RootDir gitdomain.RepoRootDir Run *git.ProdRunner Verbose bool }