gitremote

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package gitremote uses native Git with caller credentials and bounded, noninteractive transport. Subprocess output is never included in errors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultBranch

func DefaultBranch(ctx context.Context, source string) (string, error)

DefaultBranch discovers the symbolic remote HEAD rather than assuming main.

func Run

func Run(ctx context.Context, args ...string) ([]byte, error)

Run retains Git credential helpers, SSH agent/identities, aliases, ports, and trust settings. BatchMode prevents SSH password/passphrase/trust questions; Git/GCM terminal prompting is disabled. Each subprocess has a fixed deadline.

func URL

func URL(raw string) (string, error)

URL validates remote-only input without exposing it in diagnostics. HTTPS userinfo and all query/fragment components are forbidden, including tokens.

func WithRepositoryConfig

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

WithRepositoryConfig captures transport settings where native Git would read them, including conditional includes and linked-worktree configuration. Only authentication/transport settings travel to temporary repositories; repository layout, hooks and other checkout-specific settings must stay behind. Values remain in memory and child environments, never in generated team declarations. Git config also works outside a repository, retaining global configuration for directory inputs with an explicit URL and revision.

Types

This section is empty.

Jump to

Keyboard shortcuts

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