libgit

package
v0.0.0-...-4e49b11 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commit

type Commit struct {
	Date          string
	Subject       string
	Author        string
	Hash          string
	ParentHashes  []string
	LocalBranches []string
}

type Git

type Git interface {
	ValidateGitInstall() error
	IsRepoClean() (bool, error)
	GetRemote() (Remote, error)
	GetRootDir() (string, error)
	CommitFixup(commitHash string, add bool) (string, error)
	CommitEmpty(msg string) error
	GetMergedBranches(ref string) ([]string, error)
	GetCurrentBranch() (string, error)
	GetShortCommitHash(branch string) (string, error)
	Push(branchName string, opts PushOpts) (string, error)
	Rebase(branch string, opts RebaseOpts) (string, error)
	CreateBranch(name string, startPoint string) error
	DeleteBranchIfExists(name string) error
	DeleteRemoteBranchIfExists(name string) error
	Checkout(name string) error
	LogAll(notReachableFrom string) (Log, error)
	LogOneline(from string, to string) error
}

func New

func New() Git

type Log

type Log struct {
	// Commits are ordered from oldest to newest
	Commits []Commit
}

type PushOpts

type PushOpts struct {
	Force           bool
	ForceWithLease  bool
	ForceIfIncludes bool
	NoVerify        bool
}

type RebaseOpts

type RebaseOpts struct {
	Interactive bool
	Autosquash  bool
	KeepBase    bool
	UpdateRefs  bool
}

type Remote

type Remote struct {
	Kind    githost.Kind
	URLPath string // e.g. raymondji/git-stack-cli
}

type Upstream

type Upstream struct {
	Remote     string
	BranchName string
}

Jump to

Keyboard shortcuts

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