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) *repo
- type Client
- type Commit
- type Repo
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoChange = errors.New("no change")
)
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 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) GetCommitHashForRev(ctx context.Context, rev string) (string, 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 Pull(ctx context.Context, branch string) error Push(ctx context.Context, branch string) error CommitChanges(ctx context.Context, branch, message string, newBranch bool, changes map[string][]byte) error }
Repo provides functions to get and handle git data.
Click to show internal directories.
Click to hide internal directories.