Documentation
¶
Index ¶
- func AddCommitAndPushChanges(ctx context.Context, repo *goGit.Repository, workTree *goGit.Worktree, ...) plumbing.Hash
- func CheckoutToDefaultBranchAndFetchUpdates(ctx context.Context, repo *goGit.Repository, workTree *goGit.Worktree, ...)
- func CloneRepo(ctx context.Context, url string, authMethod transport.AuthMethod) *goGit.Repository
- func CreateAndCheckoutToBranch(ctx context.Context, repo *goGit.Repository, branch string, ...)
- func GetCustomerGitServerHostName(ctx context.Context) string
- func GetDefaultBranchName(ctx context.Context, authMethod transport.AuthMethod, repo *goGit.Repository) string
- func GetGitAuthMethod(ctx context.Context) (authMethod transport.AuthMethod)
- func GetRepoDir(url string) string
- func HardResetRepoToTag(ctx context.Context, repo *git.Repository, tag string)
- func WaitUntilPRMerged(ctx context.Context, repo *goGit.Repository, defaultBranchName string, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCommitAndPushChanges ¶
func CheckoutToDefaultBranchAndFetchUpdates ¶ added in v0.10.0
func CheckoutToDefaultBranchAndFetchUpdates(ctx context.Context, repo *goGit.Repository, workTree *goGit.Worktree, authMethod transport.AuthMethod, )
Removes any unstaged changes in the current branch. Then checks out to the default branch and fetches all updates.
func CloneRepo ¶
func CloneRepo(ctx context.Context, url string, authMethod transport.AuthMethod) *goGit.Repository
Clones the given git repository, if that isn't already done. When the repo is already cloned, it checks out to the default branch and fetches the latest changes.
func CreateAndCheckoutToBranch ¶
func CreateAndCheckoutToBranch(ctx context.Context, repo *goGit.Repository, branch string, workTree *goGit.Worktree, authMethod transport.AuthMethod, )
Discards all the changes in the current branch and checks out to the default branch first. Then, checks out to a new branhc with the given name. If a branch with that name already exists, then panics.
func GetCustomerGitServerHostName ¶ added in v0.9.0
Returns hostname of customer's git server.
func GetDefaultBranchName ¶
func GetDefaultBranchName(ctx context.Context, authMethod transport.AuthMethod, repo *goGit.Repository, ) string
func GetGitAuthMethod ¶
func GetGitAuthMethod(ctx context.Context) (authMethod transport.AuthMethod)
func GetRepoDir ¶ added in v0.16.0
Returns path to the directory where the given repository will be cloned.
func HardResetRepoToTag ¶ added in v0.12.0
func WaitUntilPRMerged ¶
func WaitUntilPRMerged(ctx context.Context, repo *goGit.Repository, defaultBranchName string, commitHash plumbing.Hash, auth transport.AuthMethod, branchToBeMerged string, )
TODO : Sometimes we get this error while trying to detect whether the branch has been merged or not : `unexpected EOF`. In that case, just retry instead of erroring out.
Types ¶
This section is empty.