gitremote

package
v0.102.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package gitremote validates the portable, credential-free identity of Git remotes carried across WB session-move boundaries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Identity

type Identity struct {
	Repository string
	// contains filtered or unexported fields
}

Identity binds a repository slug to either a hosted Git service or one exact clean local path. Fields other than Repository remain private so diagnostics cannot accidentally expose a local path as a remote URL.

func (Identity) Equal

func (identity Identity) Equal(other Identity) bool

Equal reports whether two safe remote spellings identify the same logical repository. SSH and HTTPS spellings on the same host compare equal; local remotes compare only when their clean absolute paths are exactly equal.

func (Identity) Host added in v0.62.2

func (identity Identity) Host() string

Host reports the lowercase host of a hosted remote, including any explicit port, and returns an empty string for a local remote. Only the host is exposed: a local remote's path stays private so diagnostics can never present it as a remote URL.

type Remote

type Remote struct {
	Raw      string
	Identity Identity
}

Remote is one safe Git remote spelling and its normalized logical identity. Raw is safe to persist because Parse rejects credentials, query strings, fragments, encoded paths, whitespace, and option-like arguments.

func Parse

func Parse(raw string) (Remote, error)

Parse validates one fixed, credential-free Git remote argument.

Jump to

Keyboard shortcuts

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