gitremote

package
v0.6.2 Latest Latest
Warning

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

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

Documentation

Overview

Package gitremote deterministically detects the git remotes configured in a local directory tree, so Wardyn can ground a composed run's GitHub grant on the workspace's ACTUAL remotes rather than an LLM guess.

It is read-only and runs NO subprocess: it parses .git/config and .gitmodules as plain files (so it can never trigger a git hook or a malicious include.path / core.fsmonitor in a repo's config). The walk is bounded (depth, .git count, file size), never follows symlinks, and fails safe — any error yields fewer/zero detected repos, never a grant on uncertainty.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectGitHubRepos

func DetectGitHubRepos(root string) (github []string, otherHosts []string)

DetectGitHubRepos walks root (bounded, no symlink following) and returns the sorted, de-duplicated set of github.com "owner/repo" remotes found in .git/config and .gitmodules files, plus the sorted set of non-GitHub remote HOSTS (for an operator warning). It never returns an error: detection is best-effort and fail-safe.

func ToSorted

func ToSorted(m map[string]struct{}) []string

ToSorted dedupes and sorts a set into a slice, nil if empty. Shared with internal/workspacescan, which already imports this package.

Types

This section is empty.

Jump to

Keyboard shortcuts

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