Documentation ¶
Index ¶
- Variables
- func AddSSHConfig(cfg config.PipedGit) error
- func MakeCommitURL(repoURL, hash string) (string, error)
- func MakeDirURL(repoURL, dir, branch string) (string, error)
- func MakeFileCreationURL(repoURL, dir, branch, filename, value string) (string, error)
- func NewRepo(dir, gitPath, remote, clonedBranch string, gitEnvs []string) *repo
- func ParseGitURL(rawURL string) (u *url.URL, err error)
- type Client
- type Commit
- type Option
- type Repo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoChange = errors.New("no change") ErrBranchNotFresh = errors.New("some refs were not updated") )
Functions ¶
func AddSSHConfig ¶
func MakeCommitURL ¶
MakeCommitURL builds a link to the HTML page of the commit, using the given repoURL and hash.
func MakeDirURL ¶
MakeDirURL builds a link to the HTML page of the directory.
func MakeFileCreationURL ¶
MakeFileCreationURL builds a link to create a file under the given directory.
Types ¶
type Client ¶
type Client interface { // Clone clones a specific git repository to the given destination. Clone(ctx context.Context, repoID, remote, branch, destination string) (Repo, error) // Clean removes all cache data. Clean() error }
Client is a git client for cloning/fetching git repo. It keeps a local cache for faster future cloning.
type Option ¶
type Option func(*client)
func WithGitEnv ¶
func WithGitEnvForRepo ¶
func WithLogger ¶
func WithPassword ¶ added in v0.48.9
func WithUserName ¶
type Repo ¶
type Repo interface { GetPath() string GetClonedBranch() string Copy(dest string) (Repo, error) ListCommits(ctx context.Context, visionRange string) ([]Commit, error) GetLatestCommit(ctx context.Context) (Commit, error) GetCommitForRev(ctx context.Context, rev string) (Commit, error) ChangedFiles(ctx context.Context, from, to string) ([]string, error) Checkout(ctx context.Context, commitish string) error CheckoutPullRequest(ctx context.Context, number int, branch string) error Clean() error CleanPath(ctx context.Context, relativePath string) error Pull(ctx context.Context, branch string) error MergeRemoteBranch(ctx context.Context, branch, commit, mergeCommitMessage string) error Push(ctx context.Context, branch string) error CommitChanges(ctx context.Context, branch, message string, newBranch bool, changes map[string][]byte, trailers map[string]string) error }
Repo provides functions to get and handle git data.
Click to show internal directories.
Click to hide internal directories.