git

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BranchMerge

func BranchMerge(branch string) (string, error)

func BranchRemote

func BranchRemote(branch string) (string, error)

func CommitCounts

func CommitCounts() (int, int, error)

func DescribeTag

func DescribeTag(ref string) (string, error)

func HasCleanWorkingTree

func HasCleanWorkingTree() (bool, error)

func HasUntracked

func HasUntracked() (bool, error)

func LsFilesUnmerged

func LsFilesUnmerged() (string, error)

func RevParseShort

func RevParseShort() (string, []byte, error)

func SparseCheckout

func SparseCheckout() (bool, error)

func SymbolicRef

func SymbolicRef(ref string) (string, error)

Types

type GitRepo

type GitRepo struct {
	GitDir                     string
	IsInGitDir                 *bool // pointer is used during checks if in a git repo
	IsInWorkTree               bool
	IsInBareRepo               bool
	IsInShallowRepo            bool
	IsSparseCheckout           bool
	Tag                        string
	AbbrevRef                  string
	ShortSha                   string
	PromptMergeStatus          string
	PromptSparseCheckoutStatus string
	PromptBranch               string
	PromptBareRepoStatus       string
}

func RevParse

func RevParse() (*GitRepo, []byte, error)

func (*GitRepo) BranchInfo

func (g *GitRepo) BranchInfo(cfg config.GitPromptStringConfig) (string, error)

func (*GitRepo) BranchStatus

func (g *GitRepo) BranchStatus(cfg config.GitPromptStringConfig) (string, string, error)

func (*GitRepo) GitDirFileExists

func (g *GitRepo) GitDirFileExists(name string) (bool, error)

func (*GitRepo) GitDirFileExistsExitOnError

func (g *GitRepo) GitDirFileExistsExitOnError(name string) bool

func (*GitRepo) GitDirPath

func (g *GitRepo) GitDirPath(path string) string

func (*GitRepo) IsGitDir

func (g *GitRepo) IsGitDir(name string) bool
func (g *GitRepo) IsGitDirSymlink(name string) bool

func (*GitRepo) ReadGitDirFile

func (g *GitRepo) ReadGitDirFile(name string) (string, error)

func (*GitRepo) ReadGitDirFileEmptyOnError added in v1.3.1

func (g *GitRepo) ReadGitDirFileEmptyOnError(name string) string

func (*GitRepo) ReadGitDirFileExitOnError

func (g *GitRepo) ReadGitDirFileExitOnError(name string) string

Jump to

Keyboard shortcuts

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