git

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MPL-2.0 Imports: 5 Imported by: 0

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