Documentation
¶
Index ¶
- Variables
- func GetLatestCommitRemote(opts ListOptions) (*string, error)
- func IsInGitCommitHistory(opts ListOptions, hash string) (bool, error)
- func PlainOpen(path string) (*git.Repository, error)
- func Pull(s *Repo, insecure bool) error
- type BaseSuite
- type CloneOptions
- type CreateOpt
- type IndexOptions
- type ListOptions
- type Repo
- func (s *Repo) Branch(name string, createOpt *CreateOpt) error
- func (s *Repo) Cleanup() error
- func (s *Repo) Commit(path, msg string, opt *IndexOptions) (string, error)
- func (s *Repo) CurrentBranch() string
- func (s *Repo) Exists(path string) (bool, error)
- func (s *Repo) FS() billy.Filesystem
- func (s *Repo) GetLatestCommit(branch string) (string, error)
- func (s *Repo) Push(downstream, branch string, insecure bool) error
- func (s *Repo) UpdateIndex(idx *IndexOptions) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRepositoryNotFound = errors.New("repository not found") ErrEmptyRemoteRepository = errors.New("remote repository is empty") ErrAuthenticationRequired = errors.New("authentication required") ErrAuthorizationFailed = errors.New("authorization failed") NoErrAlreadyUpToDate = git.NoErrAlreadyUpToDate )
Functions ¶
func GetLatestCommitRemote ¶
func GetLatestCommitRemote(opts ListOptions) (*string, error)
func IsInGitCommitHistory ¶
func IsInGitCommitHistory(opts ListOptions, hash string) (bool, error)
Types ¶
type BaseSuite ¶
type BaseSuite struct { fixtures.Suite Repository *git.Repository // contains filtered or unexported fields }
func (*BaseSuite) BuildBasicRepository ¶
func (s *BaseSuite) BuildBasicRepository()
func (*BaseSuite) GetBasicLocalRepositoryURL ¶
func (*BaseSuite) GetLocalRepositoryURL ¶
func (*BaseSuite) NewRepository ¶
NewRepository returns a new repository using the .git folder, if the fixture is tagged as worktree the filesystem from fixture is used, otherwise a new memfs filesystem is used as worktree.
func (*BaseSuite) SetUpSuite ¶
func (s *BaseSuite) SetUpSuite()
type CloneOptions ¶
type IndexOptions ¶
type ListOptions ¶
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
func Clone ¶
func Clone(opts CloneOptions) (*Repo, error)
func (*Repo) Branch ¶
Switch braches or create according to parameters passed in createOpt.
- if createOpt is `nil` no branch are created and a `git checkout` is performed on branch specified by name
- if creteOpt is different from nil and createOpt.Create is true a new branch is created checking out from the branch specified during clone - `git checkout -b branch-name`
- if creteOpt is different from nil and both createOpt.Create and createOpt.Orphan are true a new branch is created from blank with no history or parents - `git switch --orphan branch-name`
func (*Repo) CurrentBranch ¶
func (*Repo) UpdateIndex ¶
func (s *Repo) UpdateIndex(idx *IndexOptions) error
The function simulate the application of filemode of each from the origin repo (contained in "IndexOption.FromPath") to the destination repo (to files contained in IndexOption.ToPath) ---- git update-index --chmod
Click to show internal directories.
Click to hide internal directories.