gitutil

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommandContext

func CommandContext(ctx context.Context, repoRoot string, env []string, args ...string) (*exec.Cmd, error)

CommandContext builds a git command with stable non-interactive output settings.

func IsGitUnavailable

func IsGitUnavailable(err error) bool

IsGitUnavailable reports whether the git executable is unavailable on the host.

func ResolveTopLevel

func ResolveTopLevel(ctx context.Context, dir string) (string, error)

ResolveTopLevel resolves the git worktree root for dir and preserves lookup errors.

func RunCombinedOutput

func RunCombinedOutput(ctx context.Context, repoRoot string, env []string, args ...string) ([]byte, error)

RunCombinedOutput runs git and returns combined stdout/stderr with normalized errors.

func RunCombinedOutputAllowExitCodes

func RunCombinedOutputAllowExitCodes(ctx context.Context, repoRoot string, env []string, allowedExitCodes []int, args ...string) ([]byte, error)

RunCombinedOutputAllowExitCodes runs git and treats selected exit codes as success.

func ShowTopLevel

func ShowTopLevel(ctx context.Context, dir string) (string, bool)

ShowTopLevel resolves the git worktree root for dir.

Types

This section is empty.

Jump to

Keyboard shortcuts

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