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 ¶
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 ¶
type TeaRepo struct {
*git.Repository
}
TeaRepo is a go-git Repository, with an extended high level interface.
func RepoForWorkdir ¶
RepoForWorkdir tries to open the git repository in the local directory for reading or modification.
func RepoFromPath ¶
RepoFromPath tries to open the git repository by path
func (TeaRepo) GetOrCreateRemote ¶
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 ¶
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 ¶
func (r TeaRepo) TeaCheckout(ref git_plumbing.ReferenceName) error
TeaCheckout checks out the given branch in the worktree.
func (TeaRepo) TeaCreateBranch ¶
TeaCreateBranch creates a new branch in the repo, tracking from another branch.
func (TeaRepo) TeaDeleteLocalBranch ¶
func (r TeaRepo) TeaDeleteLocalBranch(branch *git_config.Branch) error
TeaDeleteLocalBranch removes the given branch locally
func (TeaRepo) TeaDeleteRemoteBranch ¶
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 ¶
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 ¶
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 ¶
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 ¶
TeaGetCurrentBranchName return the name of the branch witch is currently active