Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoChange = errors.New("no change")
)
Functions ¶
func AddSSHConfig ¶
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.