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 *configdomain.FullConfig, ...) error
- func KnowsBranchAncestors(branch gitdomain.LocalBranchName, args KnowsBranchAncestorsArgs) (bool, error)
- func KnowsBranchesAncestors(args KnowsBranchesAncestorsArgs) (bool, error)
- func NoOpenChanges(hasOpenChanges bool) error
- type KnowsBranchAncestorsArgs
- 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 *configdomain.FullConfig, localBranches gitdomain.LocalBranchNames, dialogInputs *components.TestInputs) error
IsConfigured verifies that the given Git repo contains necessary Git Town configuration.
func KnowsBranchAncestors ¶
func KnowsBranchAncestors(branch gitdomain.LocalBranchName, args KnowsBranchAncestorsArgs) (bool, error)
KnowsBranchAncestors prompts the user for all unknown ancestors of the given branch.
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 KnowsBranchAncestorsArgs ¶
type KnowsBranchAncestorsArgs struct { Backend *git.BackendCommands Config *configdomain.FullConfig DialogTestInputs *components.TestInputs LocalBranches gitdomain.LocalBranchNames MainBranch gitdomain.LocalBranchName }
type KnowsBranchesAncestorsArgs ¶
type KnowsBranchesAncestorsArgs struct { Backend *git.BackendCommands Config *configdomain.FullConfig DialogTestInputs *components.TestInputs LocalBranches gitdomain.BranchInfos }
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 }