git

package
v0.1.18-rc2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeRepoSHAV1

func ComputeRepoSHAV1(ctx context.Context, repoDir, repoSHAIn string, inputTree ...string) (string, error)

ComputeRepoSHAV1 calculates deterministic repo_sha_out for a workspace.

Algorithm:

  1. Stage workspace snapshot in a temporary git index (no ref mutations).
  2. Compute snapshot tree hash.
  3. If snapshot tree == repo_sha_in tree, return repo_sha_in.
  4. Otherwise compute synthetic commit hash from fixed metadata.

Optional inputTree may be supplied by caller when repo_sha_in is synthetic and not resolvable as a local git object.

func ComputeWorkspaceTreeSHA

func ComputeWorkspaceTreeSHA(ctx context.Context, repoDir string) (string, error)

ComputeWorkspaceTreeSHA computes a stable tree hash for the current workspace using a temporary index with pure Git staging semantics.

func EnsureCommit

func EnsureCommit(ctx context.Context, repoDir, userName, userEmail, message string) (bool, error)

EnsureCommit stages and commits all changes in the repository when any exist. Returns true when a commit was created.

func RedactError

func RedactError(err error, secret string) error

RedactError replaces any occurrence of the secret in error messages with [REDACTED]. It handles literal, query-escaped, and path-escaped variants.

func WorkspaceStatus

func WorkspaceStatus(ctx context.Context, repoDir string) (string, error)

WorkspaceStatus returns the output of `git status --porcelain` for the given directory.

Types

This section is empty.

Jump to

Keyboard shortcuts

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