Versions in this module Expand all Collapse all v4 v4.14.1 Feb 22, 2020 v4.14.0 Feb 22, 2020 Changes in this version + var ErrStorageNotFilesystem = errors.New("storer is not file based") + type AddWorktreeOptions struct + Lock bool type Repository + func (r *Repository) PlainAddWorktree(branch string, path string, o *AddWorktreeOptions) (*Repository, error) v4.13.2 Feb 21, 2020 v4.9.2 Feb 21, 2020 Changes in this version + const GitDirName + var ErrAnonymousRemoteName = errors.New("anonymous remote name must be 'anonymous'") + var ErrBranchExists = errors.New("branch already exists") + var ErrBranchHashExclusive = errors.New("Branch and Hash are mutually exclusive") + var ErrBranchNotFound = errors.New("branch not found") + var ErrCreateRequiresBranch = errors.New("Branch is mandatory when Create is used") + var ErrDeleteRefNotSupported = errors.New("server does not support delete-refs") + var ErrDestinationExists = errors.New("destination exists") + var ErrFetching = errors.New("unable to fetch packfile") + var ErrForceNeeded = errors.New("some refs were not updated") + var ErrGitModulesSymlink = errors.New(gitmodulesFile + " is a symlink") + var ErrGlobNoMatches = errors.New("glob pattern did not match any files") + var ErrHashOrReference = errors.New("ambiguous options, only one of CommitHash or ReferenceName can be passed") + var ErrInvalidReference = errors.New("invalid reference, should be a tag or a branch") + var ErrIsBareRepository = errors.New("worktree not available in a bare repository") + var ErrLooseObjectsNotSupported = errors.New("Loose objects not supported") + var ErrMissingAuthor = errors.New("author field is required") + var ErrMissingMessage = errors.New("message field is required") + var ErrMissingName = errors.New("name field is required") + var ErrMissingTagger = errors.New("tagger field is required") + var ErrMissingURL = errors.New("URL field is required") + var ErrNonFastForwardUpdate = errors.New("non-fast-forward update") + var ErrPackedObjectsNotSupported = errors.New("Packed objects not supported") + var ErrRemoteExists = errors.New("remote already exists") + var ErrRemoteNotFound = errors.New("remote not found") + var ErrRepositoryAlreadyExists = errors.New("repository already exists") + var ErrRepositoryIncomplete = errors.New("repository's commondir path does not exist") + var ErrRepositoryNotExists = errors.New("repository does not exist") + var ErrSubmoduleAlreadyInitialized = errors.New("submodule already initialized") + var ErrSubmoduleNotFound = errors.New("submodule not found") + var ErrSubmoduleNotInitialized = errors.New("submodule not initialized") + var ErrTagExists = errors.New("tag already exists") + var ErrTagNotFound = errors.New("tag not found") + var ErrUnableToResolveCommit = errors.New("unable to resolve commit") + var ErrUnstagedChanges = errors.New("worktree contains unstaged changes") + var ErrWorktreeNotClean = errors.New("worktree is not clean") + var ErrWorktreeNotProvided = errors.New("worktree should be provided") + var NoErrAlreadyUpToDate = errors.New("already up-to-date") + type BlameResult struct + Lines []*Line + Path string + Rev plumbing.Hash + func Blame(c *object.Commit, path string) (*BlameResult, error) + type CheckoutOptions struct + Branch plumbing.ReferenceName + Create bool + Force bool + Hash plumbing.Hash + Keep bool + func (o *CheckoutOptions) Validate() error + type CleanOptions struct + Dir bool + type CloneOptions struct + Auth transport.AuthMethod + Depth int + NoCheckout bool + Progress sideband.Progress + RecurseSubmodules SubmoduleRescursivity + ReferenceName plumbing.ReferenceName + RemoteName string + SingleBranch bool + Tags TagMode + URL string + func (o *CloneOptions) Validate() error + type CommitOptions struct + All bool + Author *object.Signature + Committer *object.Signature + Parents []plumbing.Hash + SignKey *openpgp.Entity + func (o *CommitOptions) Validate(r *Repository) error + type CreateTagOptions struct + Message string + SignKey *openpgp.Entity + Tagger *object.Signature + func (o *CreateTagOptions) Validate(r *Repository, hash plumbing.Hash) error + type FetchOptions struct + Auth transport.AuthMethod + Depth int + Force bool + Progress sideband.Progress + RefSpecs []config.RefSpec + RemoteName string + Tags TagMode + func (o *FetchOptions) Validate() error + type FileStatus struct + Extra string + Staging StatusCode + Worktree StatusCode + type GrepOptions struct + CommitHash plumbing.Hash + InvertMatch bool + PathSpecs []*regexp.Regexp + Patterns []*regexp.Regexp + ReferenceName plumbing.ReferenceName + func (o *GrepOptions) Validate(w *Worktree) error + type GrepResult struct + Content string + FileName string + LineNumber int + TreeName string + func (gr GrepResult) String() string + type Line struct + Author string + Date time.Time + Hash plumbing.Hash + Text string + type ListOptions struct + Auth transport.AuthMethod + type LogOptions struct + All bool + FileName *string + From plumbing.Hash + Order LogOrder + Since *time.Time + Until *time.Time + type LogOrder int8 + const LogOrderBSF + const LogOrderCommitterTime + const LogOrderDFS + const LogOrderDFSPost + const LogOrderDefault + type PlainOpenOptions struct + DetectDotGit bool + func (o *PlainOpenOptions) Validate() error + type PruneHandler func(unreferencedObjectHash plumbing.Hash) error + type PruneOptions struct + Handler PruneHandler + OnlyObjectsOlderThan time.Time + type PullOptions struct + Auth transport.AuthMethod + Depth int + Force bool + Progress sideband.Progress + RecurseSubmodules SubmoduleRescursivity + ReferenceName plumbing.ReferenceName + RemoteName string + SingleBranch bool + func (o *PullOptions) Validate() error + type PushOptions struct + Auth transport.AuthMethod + Progress sideband.Progress + Prune bool + RefSpecs []config.RefSpec + RemoteName string + func (o *PushOptions) Validate() error + type Remote struct + func NewRemote(s storage.Storer, c *config.RemoteConfig) *Remote + func (r *Remote) Config() *config.RemoteConfig + func (r *Remote) Fetch(o *FetchOptions) error + func (r *Remote) FetchContext(ctx context.Context, o *FetchOptions) error + func (r *Remote) List(o *ListOptions) (rfs []*plumbing.Reference, err error) + func (r *Remote) Push(o *PushOptions) error + func (r *Remote) PushContext(ctx context.Context, o *PushOptions) (err error) + func (r *Remote) String() string + type RepackConfig struct + OnlyDeletePacksOlderThan time.Time + UseRefDeltas bool + type Repository struct + Storer storage.Storer + func Clone(s storage.Storer, worktree billy.Filesystem, o *CloneOptions) (*Repository, error) + func CloneContext(ctx context.Context, s storage.Storer, worktree billy.Filesystem, ...) (*Repository, error) + func Init(s storage.Storer, worktree billy.Filesystem) (*Repository, error) + func Open(s storage.Storer, worktree billy.Filesystem) (*Repository, error) + func PlainClone(path string, isBare bool, o *CloneOptions) (*Repository, error) + func PlainCloneContext(ctx context.Context, path string, isBare bool, o *CloneOptions) (*Repository, error) + func PlainInit(path string, isBare bool) (*Repository, error) + func PlainOpen(path string) (*Repository, error) + func PlainOpenWithOptions(path string, o *PlainOpenOptions) (*Repository, error) + func (r *Repository) BlobObject(h plumbing.Hash) (*object.Blob, error) + func (r *Repository) BlobObjects() (*object.BlobIter, error) + func (r *Repository) Branch(name string) (*config.Branch, error) + func (r *Repository) Branches() (storer.ReferenceIter, error) + func (r *Repository) CommitObject(h plumbing.Hash) (*object.Commit, error) + func (r *Repository) CommitObjects() (object.CommitIter, error) + func (r *Repository) Config() (*config.Config, error) + func (r *Repository) CreateBranch(c *config.Branch) error + func (r *Repository) CreateRemote(c *config.RemoteConfig) (*Remote, error) + func (r *Repository) CreateRemoteAnonymous(c *config.RemoteConfig) (*Remote, error) + func (r *Repository) CreateTag(name string, hash plumbing.Hash, opts *CreateTagOptions) (*plumbing.Reference, error) + func (r *Repository) DeleteBranch(name string) error + func (r *Repository) DeleteObject(hash plumbing.Hash) error + func (r *Repository) DeleteRemote(name string) error + func (r *Repository) DeleteTag(name string) error + func (r *Repository) Fetch(o *FetchOptions) error + func (r *Repository) FetchContext(ctx context.Context, o *FetchOptions) error + func (r *Repository) Head() (*plumbing.Reference, error) + func (r *Repository) Log(o *LogOptions) (object.CommitIter, error) + func (r *Repository) Notes() (storer.ReferenceIter, error) + func (r *Repository) Object(t plumbing.ObjectType, h plumbing.Hash) (object.Object, error) + func (r *Repository) Objects() (*object.ObjectIter, error) + func (r *Repository) Prune(opt PruneOptions) error + func (r *Repository) Push(o *PushOptions) error + func (r *Repository) PushContext(ctx context.Context, o *PushOptions) error + func (r *Repository) Reference(name plumbing.ReferenceName, resolved bool) (*plumbing.Reference, error) + func (r *Repository) References() (storer.ReferenceIter, error) + func (r *Repository) Remote(name string) (*Remote, error) + func (r *Repository) Remotes() ([]*Remote, error) + func (r *Repository) RepackObjects(cfg *RepackConfig) (err error) + func (r *Repository) ResolveRevision(rev plumbing.Revision) (*plumbing.Hash, error) + func (r *Repository) Tag(name string) (*plumbing.Reference, error) + func (r *Repository) TagObject(h plumbing.Hash) (*object.Tag, error) + func (r *Repository) TagObjects() (*object.TagIter, error) + func (r *Repository) Tags() (storer.ReferenceIter, error) + func (r *Repository) TreeObject(h plumbing.Hash) (*object.Tree, error) + func (r *Repository) TreeObjects() (*object.TreeIter, error) + func (r *Repository) Worktree() (*Worktree, error) + type ResetMode int8 + const HardReset + const MergeReset + const MixedReset + const SoftReset + type ResetOptions struct + Commit plumbing.Hash + Mode ResetMode + func (o *ResetOptions) Validate(r *Repository) error + type Status map[string]*FileStatus + func (s Status) File(path string) *FileStatus + func (s Status) IsClean() bool + func (s Status) IsUntracked(path string) bool + func (s Status) String() string + type StatusCode byte + const Added + const Copied + const Deleted + const Modified + const Renamed + const Unmodified + const Untracked + const UpdatedButUnmerged + type Submodule struct + func (s *Submodule) Config() *config.Submodule + func (s *Submodule) Init() error + func (s *Submodule) Repository() (*Repository, error) + func (s *Submodule) Status() (*SubmoduleStatus, error) + func (s *Submodule) Update(o *SubmoduleUpdateOptions) error + func (s *Submodule) UpdateContext(ctx context.Context, o *SubmoduleUpdateOptions) error + type SubmoduleRescursivity uint + const DefaultRemoteName + const DefaultSubmoduleRecursionDepth + const NoRecurseSubmodules + type SubmoduleStatus struct + Branch plumbing.ReferenceName + Current plumbing.Hash + Expected plumbing.Hash + Path string + func (s *SubmoduleStatus) IsClean() bool + func (s *SubmoduleStatus) String() string + type SubmoduleUpdateOptions struct + Auth transport.AuthMethod + Init bool + NoFetch bool + RecurseSubmodules SubmoduleRescursivity + type Submodules []*Submodule + func (s Submodules) Init() error + func (s Submodules) Status() (SubmodulesStatus, error) + func (s Submodules) Update(o *SubmoduleUpdateOptions) error + func (s Submodules) UpdateContext(ctx context.Context, o *SubmoduleUpdateOptions) error + type SubmodulesStatus []*SubmoduleStatus + func (s SubmodulesStatus) String() string + type TagMode int + const AllTags + const InvalidTagMode + const NoTags + const TagFollowing + type Worktree struct + Excludes []gitignore.Pattern + Filesystem billy.Filesystem + func (w *Worktree) Add(path string) (plumbing.Hash, error) + func (w *Worktree) AddGlob(pattern string) error + func (w *Worktree) Checkout(opts *CheckoutOptions) error + func (w *Worktree) Clean(opts *CleanOptions) error + func (w *Worktree) Commit(msg string, opts *CommitOptions) (plumbing.Hash, error) + func (w *Worktree) Grep(opts *GrepOptions) ([]GrepResult, error) + func (w *Worktree) Move(from, to string) (plumbing.Hash, error) + func (w *Worktree) Pull(o *PullOptions) error + func (w *Worktree) PullContext(ctx context.Context, o *PullOptions) error + func (w *Worktree) Remove(path string) (plumbing.Hash, error) + func (w *Worktree) RemoveGlob(pattern string) error + func (w *Worktree) Reset(opts *ResetOptions) error + func (w *Worktree) Status() (Status, error) + func (w *Worktree) Submodule(name string) (*Submodule, error) + func (w *Worktree) Submodules() (Submodules, error) Other modules containing this package github.com/cooper/go-git