validation

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckBranchAlreadyInEnvironment

func CheckBranchAlreadyInEnvironment(env metadata.Environment, branchName, envName string) error

CheckBranchAlreadyInEnvironment checks if branch is already in the target environment

func CheckUnstagedChanges

func CheckUnstagedChanges(repo *hitchgit.Repo, operation, context string) error

CheckUnstagedChanges validates that the repository has no uncommitted changes

func FormatBranchNotFoundError

func FormatBranchNotFoundError(branchName string) string

FormatBranchNotFoundError generates the error message for missing branches

func FormatEnvironmentNotFoundError

func FormatEnvironmentNotFoundError(envName string, environments map[string]metadata.Environment) string

FormatEnvironmentNotFoundError generates the error message for missing environments

func FormatRepositoryValidationError

func FormatRepositoryValidationError(validationResult hitchgit.ValidationResult, operation string) string

FormatRepositoryValidationError generates the error message for repository validation failures

func FormatUnstagedChangesMessage

func FormatUnstagedChangesMessage(operation, context string) string

FormatUnstagedChangesMessage generates the error message for unstaged changes

func InitializeRepositoryAndMetadata

func InitializeRepositoryAndMetadata() (*hitchgit.Repo, *metadata.Metadata, error)

InitializeRepositoryAndMetadata performs common repository initialization steps

func SetupBranchRestoration

func SetupBranchRestoration(repo *hitchgit.Repo) string

SetupBranchRestoration saves current branch for later restoration

func ValidateBranchExists

func ValidateBranchExists(repo *hitchgit.Repo, branchName string) error

ValidateBranchExists validates that a branch exists in the repository

func ValidateEnvironmentExists

func ValidateEnvironmentExists(meta *metadata.Metadata, envName string) (metadata.Environment, error)

ValidateEnvironmentExists validates that an environment exists in metadata

func ValidateGitUserInfo

func ValidateGitUserInfo(repo *hitchgit.Repo) (string, string, error)

ValidateGitUserInfo validates that git user information is configured

func ValidateRepositoryState

func ValidateRepositoryState(repo *hitchgit.Repo, operation string) error

ValidateRepositoryState performs comprehensive repository validation

Types

This section is empty.

Jump to

Keyboard shortcuts

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