internal

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package internal contains internal utilities for gitcc.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidSHA = errors.New("invalid SHA")

ErrInvalidSHA is returned when an invalid SHA string is provided.

View Source
var ErrNoCommonAncestor = errors.New("no common ancestor found")

ErrNoCommonAncestor is returned when no common ancestor is found between the source and target branches.

Functions

func CopyFile

func CopyFile(src string, dst string) error

CopyFile copies a file from src to dst. If dst does not exist, it will be created.

func GetMergeBase

func GetMergeBase(repo *git.Repository, targetBranch string) (*object.Commit, error)

GetMergeBase finds the common ancestor (merge base) between the current HEAD and the specified target branch. It returns ErrNoCommonAncestor if no common ancestor is found.

func LoadRepository

func LoadRepository(path string) (*git.Repository, error)

LoadRepository opens a Git repository at the specified path. It detects the .git directory automatically.

func ValidateCommit

func ValidateCommit(validator gitcc.Validator, repo *git.Repository, sha string) (gitcc.Result, error)

ValidateCommit validates a specific commit by its SHA string.

func ValidateHead

func ValidateHead(validator gitcc.Validator, repo *git.Repository) (gitcc.Result, error)

ValidateHead validates the current HEAD commit.

func ValidateHistory

func ValidateHistory(validator gitcc.Validator, repo *git.Repository, exitSha string) ([]gitcc.Result, error)

ValidateHistory validates the commit history starting from HEAD until the exitSha (exclusive). If exitSha is empty, it validates the entire history.

Types

This section is empty.

Jump to

Keyboard shortcuts

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