Versions in this module Expand all Collapse all v1 v1.55.0 Sep 11, 2026 v1.54.0 Sep 8, 2026 Changes in this version + const EmptyTreeSHA + func AddRemote(ctx context.Context, dir, name, url string) error + func AdoptBranchRef(run RefRunner, branch, newHeadSHA, recordedHeadSHA string) error + func BoundContext(ctx context.Context, args ...string) (context.Context, context.CancelFunc) + func BranchRef(branch string) string + func CommandWaitDelay() time.Duration + func CommitAll(ctx context.Context, dir, message string) error + func CommitAuthorEmail(ctx context.Context, dir, sha string) (string, error) + func CommitTime(ctx context.Context, dir, sha string) (time.Time, error) + func CopyLocalUserIdentity(ctx context.Context, srcDir, dstDir string) error + func CreateBranch(ctx context.Context, dir, name string) error + func CurrentBranch(ctx context.Context, dir string) (string, error) + func DefaultBranch(ctx context.Context, dir, remote string) string + func Diff(ctx context.Context, dir, base, head string) (string, error) + func DiffHead(ctx context.Context, dir string) (string, error) + func DiffNameOnly(ctx context.Context, dir, base, head string) ([]string, error) + func DiffStat(ctx context.Context, dir, base, head string) (files, lines int, err error) + func EnsureHooksPathIsolation(ctx context.Context, bareDir string) (bool, error) + func EnsureRemote(ctx context.Context, dir, name, url string) error + func FetchRemoteBranch(ctx context.Context, dir, remote, branch string) error + func FetchRemoteBranchToPrivateRef(ctx context.Context, dir, remote, branch, localRef string) error + func FetchRemoteBranchToRef(ctx context.Context, dir, remote, branch, localRef string) error + func FindGitRoot(path string) (string, error) + func FindMainRepoRoot(path string) (string, error) + func GateConfigCurrent(bareDir string) bool + func GetConfiguredRemoteURL(ctx context.Context, dir, name string) (string, error) + func GetConfiguredRemoteURLs(ctx context.Context, dir, name string) ([]string, error) + func GetRemoteURL(ctx context.Context, dir, name string) (string, error) + func HasRemote(ctx context.Context, dir, name string) (bool, error) + func HasUncommittedChanges(ctx context.Context, dir string) (bool, error) + func HeadSHA(ctx context.Context, dir string) (string, error) + func InitBare(ctx context.Context, path string) error + func InspectRemoteDefaultBranch(ctx context.Context, dir, remote string) (string, []string, error) + func InstallPostReceiveHook(bareDir string) error + func IsDetachedHEAD(ctx context.Context, dir string) (bool, error) + func IsZeroSHA(sha string) bool + func IsolateHooksPath(ctx context.Context, bareDir string) error + func Log(ctx context.Context, dir, base, head string) (string, error) + func LooksLikeBareRepository(dir string) bool + func LsRemote(ctx context.Context, dir, remote, ref string) (string, error) + func MarkGateConfigCurrent(bareDir string) error + func NonInteractiveEnv(dir string) []string + func NonInteractiveEnvFrom(base []string, dir string) []string + func Output(ctx context.Context, dir string, args ...string) (string, error) + func OutputBare(ctx context.Context, bareDir string, args ...string) (string, error) + func PostReceiveHookScript() string + func PreReceiveHookScript() string + func Push(ctx context.Context, dir, remote, ref, expectedSHA string, forceWithLease bool) error + func PushCommit(ctx context.Context, dir, remote, commitSHA, ref, expectedSHA string, ...) error + func PushWithOptions(ctx context.Context, dir, remote, ref, expectedSHA string, forceWithLease bool, ...) error + func RefExists(ctx context.Context, dir, ref string) (bool, error) + func RefreshManagedGateHooks(bareDir string) error + func RefreshManagedPostReceiveHook(bareDir string) (bool, error) + func RefreshManagedPreReceiveHook(bareDir string) (bool, error) + func RemoveRemote(ctx context.Context, dir, name string) error + func ResolveRef(ctx context.Context, dir, ref string) (string, error) + func Run(ctx context.Context, dir string, args ...string) (string, error) + func RunBare(ctx context.Context, bareDir string, args ...string) (string, error) + func RunRaw(ctx context.Context, dir string, args ...string) ([]byte, error) + func RunWithEnv(ctx context.Context, dir string, extraEnv []string, args ...string) (string, error) + func ShowFile(ctx context.Context, dir, ref, path string) (string, error) + func ValidateBareRepository(ctx context.Context, bareDir string) error + func WorktreeAdd(ctx context.Context, repoDir, wtPath, sha string) error + func WorktreeRemove(ctx context.Context, repoDir, wtPath string) error + type RefRunner func(args ...string) (string, error)