git

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package git provides helpers for reading diffs, staged changes, and commit history used by the scanning engine for different scan modes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiffAgainst

func DiffAgainst(root, base string) ([]string, [][]byte, error)

func RepoMetadata

func RepoMetadata(root string) (string, string, string)

RepoMetadata returns (repo, commit, branch) best-effort for the given root. Empty strings are returned on failure. It avoids heavy git calls and uses simple plumbing to remain fast in CI.

func StagedDiff

func StagedDiff(root string) ([]string, [][]byte, error)

Types

type Entry

type Entry struct {
	Hash  string
	Files map[string][]byte
}

func LastNCommits

func LastNCommits(root string, n int) ([]Entry, error)

Jump to

Keyboard shortcuts

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