gitutil

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHEAD

func GetHEAD(reposPath pathutil.ReposPath) (string, error)

GetHEAD gets HEAD reference hash string from reposPath. See GetHEADRepository.

func GetHEADRepository added in v0.3.2

func GetHEADRepository(repos *git.Repository) (string, error)

GetHEADRepository gets HEAD reference hash string from git.Repository. If the repository is bare:

Return the reference of refs/remotes/origin/{branch}
where {branch} is default branch

If the repository is non-bare:

Return the reference of current branch's HEAD

func GetUpstreamRemote added in v0.3.2

func GetUpstreamRemote(r *git.Repository) (string, error)

GetUpstreamRemote gets current branch's upstream remote name (e.g. "origin").

func SetUpstreamRemote added in v0.3.2

func SetUpstreamRemote(r *git.Repository, remote string) error

SetUpstreamRemote sets current branch's upstream remote name to remote.

Types

This section is empty.

Jump to

Keyboard shortcuts

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