validate

package
v10.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2023 License: MIT Imports: 13 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 HasGitVersion

func HasGitVersion(majorVersion, minorVersion int) error

HasGitVersion 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, 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

func NoOpenChanges(hasOpenChanges bool) error

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
}

Jump to

Keyboard shortcuts

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