gitremote

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package gitremote reads a remote repository's refs over HTTPS (§5.8 polling): the equivalent of `git ls-remote`, without a git binary or a clone. It speaks the smart HTTP protocol and falls back to dumb HTTP.

Index

Constants

This section is empty.

Variables

View Source
var SelfSignedCA func(host string) string

SelfSignedCA returns the certificate of a platform host (the built-in Git server) while it is self-signed, so polling it works on private networks; nil or "" = system roots only.

Functions

func BranchSHA

func BranchSHA(refs map[string]string, branch string) (string, bool)

BranchSHA returns the commit of a branch.

func IsPattern

func IsPattern(p string) bool

IsPattern reports whether p has glob characters.

func LsRemote

func LsRemote(ctx context.Context, repoURL, token string) (map[string]string, error)

LsRemote returns ref name -> commit SHA.

func Match

func Match(refs map[string]string, branches, tags string) map[string]string

Match returns the refs whose branch matches branches or whose tag matches tags ("" = none), as full ref name -> commit. Annotated tags resolve to the commit they point at.

func ShortRef

func ShortRef(ref string) string

ShortRef turns refs/heads/main into main and refs/tags/v1 into v1.

func ValidatePattern

func ValidatePattern(p string) error

ValidatePattern checks a branch or tag pattern: a name, optionally with globs ("release/*", "v*").

func ValidateURL

func ValidateURL(raw string) error

ValidateURL accepts http(s) repository URLs without embedded credentials.

Types

This section is empty.

Jump to

Keyboard shortcuts

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