validate

package
v12.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package validate provides functionality to validate the status of Git repositories. These validators are used mostly inside Cobra commands.

Index

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

func HasAcceptableGitVersion(majorVersion, minorVersion int) error

HasAcceptableGitVersion verifies that the system has Git of version 2.7 or newer installed.

func IsAcceptableGitVersion

func IsAcceptableGitVersion(major, minor int) bool

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

func NoOpenChanges(hasOpenChanges bool) error

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL