git

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: MPL-2.0 Imports: 5 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 git inspects the current repository and parses git remote metadata.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseRemoteURL

func ParseRemoteURL(raw string) (host, owner, repo string, err error)

ParseRemoteURL parses a git remote URL into host, owner, and repository name.

Types

type RepoContext

type RepoContext struct {
	// Root is the repository root directory.
	Root string
	// RemoteName is the git remote name that was inspected.
	RemoteName string
	// RemoteURL is the git remote URL.
	RemoteURL string
	// RepoOwner is the remote repository owner or namespace.
	RepoOwner string
	// RepoName is the remote repository name.
	RepoName string
	// RepoSlug is the owner and repository name joined as owner/repo.
	RepoSlug string
	// RemoteHost is the remote repository host.
	RemoteHost string
	// CurrentBranch is the currently checked out branch name.
	CurrentBranch string
}

RepoContext describes the current git repository and selected remote.

func Inspect

func Inspect(remote string) (*RepoContext, error)

Inspect gathers repository details for the current working tree and remote.

Jump to

Keyboard shortcuts

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