git

package
v0.20.2 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangedLineRanges added in v0.14.17

func ChangedLineRanges(logger *zap.Logger, repoPath, baseRef, headRef string) (map[string][]LineRange, error)

ChangedLineRanges returns added/changed head-side line ranges from a git diff. Deleted-only hunks are omitted because there is no head line for SARIF to annotate.

func CheckoutRef

func CheckoutRef(logger *zap.Logger, repoPath, ref string) error

CheckoutRef checks out ref in repoPath.

func CloneTemp

func CloneTemp(logger *zap.Logger, repoURL, ref string) (string, error)

CloneTemp clones repoURL into a temporary directory and optionally checks out ref. The caller owns cleanup of the returned directory.

func FindRepoRoot

func FindRepoRoot(logger *zap.Logger, path string) (string, error)

FindRepoRoot resolves the git repository root for path.

func MaterializeLocalRef

func MaterializeLocalRef(logger *zap.Logger, sourceRepoPath, ref string) (string, error)

MaterializeLocalRef clones sourceRepoPath into a temporary directory and checks out ref. The caller owns cleanup of the returned directory.

func VerifyRef

func VerifyRef(logger *zap.Logger, repoPath, ref string) error

VerifyRef verifies that ref resolves to a commit in repoPath.

Types

type LineRange added in v0.14.17

type LineRange struct {
	Start int
	End   int
}

LineRange is an inclusive 1-based line range in a repository file.

Jump to

Keyboard shortcuts

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