Documentation ¶
Index ¶
- func GetAuthForURL(remoteURL *url.URL, authToken, keyFile string, passwordCallback pwCallback) (git_transport.AuthMethod, 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(ref git_plumbing.ReferenceName) error
- func (r TeaRepo) TeaCreateBranch(localBranchName, remoteBranchName, remoteName string) error
- func (r TeaRepo) TeaDeleteLocalBranch(branch *git_config.Branch) error
- func (r TeaRepo) TeaDeleteRemoteBranch(remoteName, 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) TeaFindBranchRemote(branchName, hash string) (*git.Remote, error)
- func (r TeaRepo) TeaGetCurrentBranchName() (string, 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, authToken, keyFile string, passwordCallback pwCallback) (git_transport.AuthMethod, 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 RepoFromPath ¶ added in v0.4.0
RepoFromPath tries to open the git repository by path
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
func (r TeaRepo) TeaCheckout(ref git_plumbing.ReferenceName) error
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) TeaDeleteLocalBranch ¶ added in v0.7.0
func (r TeaRepo) TeaDeleteLocalBranch(branch *git_config.Branch) error
TeaDeleteLocalBranch removes the given branch locally
func (TeaRepo) TeaDeleteRemoteBranch ¶ added in v0.7.0
func (r TeaRepo) TeaDeleteRemoteBranch(remoteName, remoteBranch string, auth git_transport.AuthMethod) error
TeaDeleteRemoteBranch removes the given branch on the given remote via git protocol
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.
func (TeaRepo) TeaFindBranchRemote ¶ added in v0.5.0
TeaFindBranchRemote gives the first remote that has a branch with the same name or sha, depending on what is passed in. This function is needed, as git does not always define branches in .git/config with remote entries.
func (TeaRepo) TeaGetCurrentBranchName ¶ added in v0.4.0
TeaGetCurrentBranchName return the name of the branch witch is currently active