Documentation ¶
Index ¶
- func CheckForGitUsername() (string, error)
- func CheckoutMasterAndPull() error
- func CloneRepository(name string, sshURL string, path string) error
- func CurrentBranch() (string, error)
- func CurrentRepositoryName() (string, error)
- func CurrentRepositoryOrganization() (string, error)
- func ExtractOrganizationAndRepoNameFromRepoURL(url string) (organization string, repo string)
- func GetCurrentGitBaseURL() string
- func HasUnpushedChangesOrCommits() (bool, error)
- func IsEnterpriseGit() (bool, error)
- func NewClient(ctx context.Context, token string) *github.Client
- func NewEnterpriseClient(ctx context.Context, hostname string, token string) (*github.Client, error)
- func PushBranchToOrigin(cb string) (err error)
- func RemoteRefExists(ref string) bool
- func RemoteRefOfCurrentBranchExists() (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckForGitUsername ¶
CheckForGitUsername checks for a git username set in the expected location
func CheckoutMasterAndPull ¶
func CheckoutMasterAndPull() error
CheckoutMasterAndPull checks out the current branch to master and pulls down the latest
func CloneRepository ¶
CloneRepository accepts an ssh url and clones a repository to a specified directory
func CurrentBranch ¶
CurrentBranch returns the name of the branch in the current working directory
func CurrentRepositoryName ¶
CurrentRepositoryName returns the name of the repository of the current working directory from any of its subdirectories
func CurrentRepositoryOrganization ¶
CurrentRepositoryOrganization parses the local git config's remote.origin.url to determine the 'organization' or top-level 'user' of a repository
func ExtractOrganizationAndRepoNameFromRepoURL ¶
ExtractOrganizationAndRepoNameFromRepoURL parses the organization/user and repository name from the repo URL - the usecase here is when results are returned from search and information about the repository/organization aren't available absent parsing this value and/or making an additional API call example RepositoryURL: "https://api.github.com/repos/counterThreat/chess_app",
func GetCurrentGitBaseURL ¶
func GetCurrentGitBaseURL() string
GetCurrentGitBaseURL returns the current base git url
func HasUnpushedChangesOrCommits ¶
HasUnpushedChangesOrCommits checks whether there are unpushed local commits
func IsEnterpriseGit ¶
IsEnterpriseGit is a helper for determining whether or not the active repository is from github.com or an enterprise instance
func NewEnterpriseClient ¶
func NewEnterpriseClient(ctx context.Context, hostname string, token string) (*github.Client, error)
NewEnterpriseClient creates a new github enterprise client
func PushBranchToOrigin ¶
PushBranchToOrigin pushes the current working directory's branch to origin
func RemoteRefExists ¶
RemoteRefExists returns a bool for whether a remote reference to a pull request exists
func RemoteRefOfCurrentBranchExists ¶
RemoteRefOfCurrentBranchExists checks whether a remote ref of the current working directory's branch exists
Types ¶
This section is empty.