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 HasGitVersion(majorVersion, minorVersion int) error
- func IsAcceptableGitVersion(major, minor int) bool
- func IsConfigured(backend *git.BackendCommands, branches domain.Branches) (domain.BranchTypes, error)
- func KnowsBranchAncestors(branch domain.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 HasGitVersion ¶
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, branches domain.Branches) (domain.BranchTypes, error)
IsConfigured verifies that the given Git repo contains necessary Git Town configuration.
func KnowsBranchAncestors ¶
func KnowsBranchAncestors(branch domain.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 { AllBranches domain.BranchInfos Backend *git.BackendCommands BranchTypes domain.BranchTypes DefaultBranch domain.LocalBranchName MainBranch domain.LocalBranchName }
type KnowsBranchesAncestorsArgs ¶
type KnowsBranchesAncestorsArgs struct { AllBranches domain.BranchInfos Backend *git.BackendCommands BranchTypes domain.BranchTypes MainBranch domain.LocalBranchName }
type UnfinishedStateArgs ¶
type UnfinishedStateArgs struct { Connector hosting.Connector Verboe bool Lineage config.Lineage InitialBranchesSnapshot domain.BranchesSnapshot InitialConfigSnapshot undo.ConfigSnapshot InitialStashSnapshot domain.StashSnapshot PushHook bool RootDir domain.RepoRootDir Run *git.ProdRunner }