Documentation ¶
Index ¶
- func GetAuthForURL(remoteURL *url.URL, httpUser, keyFile string) (auth git_transport.AuthMethod, err error)
- func ParseURL(rawURL string) (u *url.URL, err error)
- type TeaRepo
- func (r TeaRepo) GetOrCreateRemote(remoteURL, newRemoteName string) (*git.Remote, error)
- func (r TeaRepo) GetRemote(remoteURL string) (*git.Remote, error)
- func (r TeaRepo) TeaCheckout(branchName string) error
- func (r TeaRepo) TeaCreateBranch(localBranchName, remoteBranchName, remoteName string) error
- func (r TeaRepo) TeaDeleteBranch(branch *git_config.Branch, remoteBranch string, auth git_transport.AuthMethod) error
- func (r TeaRepo) TeaFindBranchByName(branchName, repoURL string) (b *git_config.Branch, err error)
- func (r TeaRepo) TeaFindBranchBySha(sha, repoURL string) (b *git_config.Branch, err error)
- func (r TeaRepo) TeaRemoteURL(name string) (auth *url.URL, err error)
- type URLParser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAuthForURL ¶ added in v0.3.0
func GetAuthForURL(remoteURL *url.URL, httpUser, keyFile string) (auth git_transport.AuthMethod, err error)
GetAuthForURL returns the appropriate AuthMethod to be used in Push() / Pull() operations depending on the protocol, and prompts the user for credentials if necessary.
Types ¶
type TeaRepo ¶ added in v0.3.0
type TeaRepo struct {
*git.Repository
}
TeaRepo is a go-git Repository, with an extended high level interface.
func RepoForWorkdir ¶ added in v0.3.0
RepoForWorkdir tries to open the git repository in the local directory for reading or modification.
func (TeaRepo) GetOrCreateRemote ¶ added in v0.3.0
GetOrCreateRemote tries to match a Remote of the repo via the given URL. If no match is found, a new Remote with `newRemoteName` is created. Matching is based on the normalized URL, accepting different protocols.
func (TeaRepo) GetRemote ¶ added in v0.3.0
GetRemote tries to match a Remote of the repo via the given URL. Matching is based on the normalized URL, accepting different protocols.
func (TeaRepo) TeaCheckout ¶ added in v0.3.0
TeaCheckout checks out the given branch in the worktree.
func (TeaRepo) TeaCreateBranch ¶ added in v0.3.0
TeaCreateBranch creates a new branch in the repo, tracking from another branch.
func (TeaRepo) TeaDeleteBranch ¶ added in v0.3.0
func (r TeaRepo) TeaDeleteBranch(branch *git_config.Branch, remoteBranch string, auth git_transport.AuthMethod) error
TeaDeleteBranch removes the given branch locally, and if `remoteBranch` is not empty deletes it at it's remote repo.
func (TeaRepo) TeaFindBranchByName ¶ added in v0.3.0
func (r TeaRepo) TeaFindBranchByName(branchName, repoURL string) (b *git_config.Branch, err error)
TeaFindBranchByName returns a branch that is at the the given local and remote names and syncs to the given remote repo. This method is less precise than TeaFindBranchBySha(), but may be desirable if local and remote branch have diverged.
func (TeaRepo) TeaFindBranchBySha ¶ added in v0.3.0
func (r TeaRepo) TeaFindBranchBySha(sha, repoURL string) (b *git_config.Branch, err error)
TeaFindBranchBySha returns a branch that is at the the given SHA and syncs to the given remote repo.