git

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package git provides Git repository operations and types for the gh-compare CLI extension.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotAGitRepository = errors.New("not a git repository")
	ErrNoCurrentBranch   = errors.New("no current branch found")
	ErrNoRemoteFound     = errors.New("no remote found")
	ErrInvalidRemoteURL  = errors.New("invalid remote URL")
)

Functions

This section is empty.

Types

type CompareRequest

type CompareRequest struct {
	BaseBranch   string
	HeadBranch   string
	Repository   *Repository
	CustomFormat string
}

func (*CompareRequest) BuildArgument

func (c *CompareRequest) BuildArgument() string

type Remote

type Remote struct {
	Name string
	URL  string
}

type Repository

type Repository struct {
	Path          string
	CurrentBranch string
	Remotes       []Remote
	IsForked      bool
}

func NewRepository

func NewRepository(path string) (*Repository, error)

func (*Repository) GetDefaultBranch

func (r *Repository) GetDefaultBranch() (string, error)

func (*Repository) GetOriginOwner

func (r *Repository) GetOriginOwner() (string, error)

func (*Repository) GetRemote

func (r *Repository) GetRemote(name string) (*Remote, error)

func (*Repository) HasRemote

func (r *Repository) HasRemote(name string) bool

Jump to

Keyboard shortcuts

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