Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoOriginHEAD = errors.New("origin/HEAD is not set")
ErrNoOriginHEAD is returned by MergeBase when the upstream tracking branch is set but origin/HEAD is not — a common state after git init + push without fetch.
Functions ¶
func CreateBundle ¶ added in v0.7.122
CreateBundle creates a git bundle from base..HEAD in the repo at cwd and returns the raw bytes. If base is empty, the full history up to HEAD is bundled.
func CurrentBranch ¶
CurrentBranch returns the current git branch name. Returns an error if in detached HEAD state or not in a git repo.
func GeneratePatch ¶
GeneratePatch generates a binary diff from the given base commit, including untracked files. It temporarily stages untracked files with git add -N and resets them after generating the diff.
func HeadRef ¶ added in v0.7.122
HeadRef returns the SHA of the current HEAD commit in the repo at cwd.
func IsBranchPushed ¶ added in v0.7.1
func IsBranchPushed() bool
IsBranchPushed returns true if the current branch exists on the remote (i.e. refs/remotes/origin/<branch> is present locally).
Types ¶
This section is empty.