Documentation ¶
Overview ¶
Copyright 2019 The Chromium OS Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
Index ¶
- Variables
- func AddRemote(gitRepo, remote, remoteLocation string) error
- func Checkout(gitRepo, branch string) error
- func Clone(remote, dir string) error
- func CommitAll(gitRepo, commitMsg string) (string, error)
- func CommitEmpty(gitRepo, commitMsg string) (string, error)
- func CreateBranch(gitRepo, branch string) error
- func CreateTrackingBranch(gitRepo, branch string, remoteRef RemoteRef) error
- func DeleteBranch(gitRepo, branch string, force bool) error
- func GetCurrentBranch(cwd string) string
- func GetGitRepoRevision(cwd, branch string) (string, error)
- func Init(gitRepo string, bare bool) error
- func IsReachable(cwd, to_ref, from_ref string) (bool, error)
- func IsSHA(ref string) bool
- func MatchBranchName(gitRepo string, pattern *regexp.Regexp) ([]string, error)
- func MatchBranchNameWithNamespace(gitRepo string, pattern, namespace *regexp.Regexp) ([]string, error)
- func NormalizeRef(ref string) string
- func PushRef(gitRepo, localRef string, pushTo RemoteRef, opts GitOpts) error
- func RemoteBranches(gitRepo, remote string) ([]string, error)
- func RemoteHasBranch(gitRepo, remote, branch string) (bool, error)
- func RunGitIgnoreOutput(gitRepo string, cmd []string) error
- func StripRefs(ref string) string
- func StripRefsHead(ref string) string
- type CommandOutput
- type GitOpts
- type RemoteRef
Constants ¶
This section is empty.
Variables ¶
var (
CommandRunnerImpl cmd.CommandRunner = cmd.RealCommandRunner{}
)
Functions ¶
func CommitEmpty ¶
CommitEmpty makes an empty commit (assuming nothing is staged). Returns the sha1 of the commit.
func CreateTrackingBranch ¶
CreateTrackingBranch creates a tracking branch.
func DeleteBranch ¶
DeleteBranch checks out to master and then deletes the current branch.
func GetCurrentBranch ¶
GetCurrentBranch returns current branch of a repo, and an empty string if repo is on detached HEAD.
func GetGitRepoRevision ¶
GetGitRepoRevision finds and returns the revision of a branch.
func IsReachable ¶
IsReachable determines whether one commit ref is reachable from another.
func MatchBranchName ¶
MatchBranchName returns the names of branches who match the specified regular expression.
func MatchBranchNameWithNamespace ¶
func MatchBranchNameWithNamespace(gitRepo string, pattern, namespace *regexp.Regexp) ([]string, error)
MatchBranchNameWithNamespace returns the names of branches who match the specified pattern and start with the specified namespace.
func NormalizeRef ¶
NormalizeRef converts git branch refs into fully qualified form.
func RemoteBranches ¶
RemoteBranches returns a list of branches on the specified remote.
func RemoteHasBranch ¶
RemoteHasBranch checks whether or not a branch exists on a remote.
func RunGitIgnoreOutput ¶
RunGitIgnore the specified git command in the specified repo and returns only an error, not the command output.
func StripRefsHead ¶
StripRefsHead removes leading 'refs/heads/' from a ref name.