Documentation
¶
Index ¶
- func AllReferencesFilter(_ string) bool
- type BatchObjectIter
- type Commit
- type IncludeExcludeFilter
- type OID
- type ObjectHeaderIter
- type ObjectIter
- type ObjectType
- type Polarity
- type Reference
- type ReferenceFilter
- type ReferenceIter
- type Repository
- func (repo *Repository) Close() error
- func (repo *Repository) NewBatchObjectIter() (*BatchObjectIter, io.WriteCloser, error)
- func (repo *Repository) NewObjectIter(args ...string) (*ObjectIter, io.WriteCloser, error)
- func (repo *Repository) NewReferenceIter() (*ReferenceIter, error)
- func (repo *Repository) Path() string
- type Tag
- type Tree
- type TreeEntry
- type TreeIter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllReferencesFilter ¶
Types ¶
type BatchObjectIter ¶
type BatchObjectIter struct {
// contains filtered or unexported fields
}
func (*BatchObjectIter) Close ¶
func (l *BatchObjectIter) Close() error
func (*BatchObjectIter) Next ¶
func (iter *BatchObjectIter) Next() (OID, ObjectType, counts.Count32, []byte, error)
type IncludeExcludeFilter ¶ added in v1.4.0
type IncludeExcludeFilter struct {
// contains filtered or unexported fields
}
IncludeExcludeFilter is a filter based on a bunch of `polarizedFilter`s. The last one that matches a reference wins. If none match, then the result is based on the polarity of the first polarizedFilter: if it is `Include`, then return `false`; if it is `Exclude`, then return `true`.
func (*IncludeExcludeFilter) Exclude ¶ added in v1.4.0
func (ief *IncludeExcludeFilter) Exclude(f ReferenceFilter)
func (*IncludeExcludeFilter) Filter ¶ added in v1.4.0
func (ief *IncludeExcludeFilter) Filter(refname string) bool
func (*IncludeExcludeFilter) Include ¶ added in v1.4.0
func (ief *IncludeExcludeFilter) Include(f ReferenceFilter)
type OID ¶
type OID struct {
// contains filtered or unexported fields
}
var NullOID OID
func OIDFromBytes ¶
func (OID) MarshalJSON ¶
type ObjectHeaderIter ¶
type ObjectHeaderIter struct {
// contains filtered or unexported fields
}
func NewObjectHeaderIter ¶
func NewObjectHeaderIter(name string, data []byte) (ObjectHeaderIter, error)
Iterate over a commit or tag object header. `data` should be the object's contents, which is usually terminated by a blank line that separates the header from the comment. However, annotated tags don't always include comments, and Git even tolerates commits without comments, so don't insist on a blank line. `name` is used in error messages.
func (*ObjectHeaderIter) HasNext ¶
func (iter *ObjectHeaderIter) HasNext() bool
type ObjectIter ¶
type ObjectIter struct {
// contains filtered or unexported fields
}
func (*ObjectIter) Close ¶
func (l *ObjectIter) Close() error
func (*ObjectIter) Next ¶
func (l *ObjectIter) Next() (OID, ObjectType, counts.Count32, error)
Next returns the next object, or EOF when done.
type ObjectType ¶
type ObjectType string
The type of an object ("blob", "tree", "commit", "tag", "missing").
type Reference ¶
type Reference struct { Refname string ObjectType ObjectType ObjectSize counts.Count32 OID OID }
type ReferenceFilter ¶
func PrefixFilter ¶
func PrefixFilter(prefix string) ReferenceFilter
PrefixFilter returns a `ReferenceFilter` that matches references whose names start with the specified `prefix`, which must match at a component boundary. For example,
- Prefix "refs/foo" matches "refs/foo" and "refs/foo/bar" but not "refs/foobar".
- Prefix "refs/foo/" matches "refs/foo/bar" but not "refs/foo" or "refs/foobar".
func RegexpFilter ¶ added in v1.4.0
func RegexpFilter(pattern string) (ReferenceFilter, error)
RegexpFilter returns a `ReferenceFilter` that matches references whose names match the specified `prefix`, which must match the whole reference name.
type ReferenceIter ¶
type ReferenceIter struct {
// contains filtered or unexported fields
}
func (*ReferenceIter) Close ¶
func (l *ReferenceIter) Close() error
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(path string) (*Repository, error)
NewRepository creates a new repository object that can be used for running `git` commands within that repository.
func (*Repository) Close ¶
func (repo *Repository) Close() error
func (*Repository) NewBatchObjectIter ¶
func (repo *Repository) NewBatchObjectIter() (*BatchObjectIter, io.WriteCloser, error)
NewBatchObjectIter returns iterates over objects whose names are fed into its stdin. The output is buffered, so it has to be closed before you can be sure to read all of the objects.
func (*Repository) NewObjectIter ¶
func (repo *Repository) NewObjectIter(args ...string) ( *ObjectIter, io.WriteCloser, error, )
NewObjectIter returns an iterator that iterates over objects in `repo`. The second return value is the stdin of the `rev-list` command. The caller can feed values into it but must close it in any case.
func (*Repository) NewReferenceIter ¶
func (repo *Repository) NewReferenceIter() (*ReferenceIter, error)
NewReferenceIter returns an iterator that iterates over all of the references in `repo`.
func (*Repository) Path ¶
func (repo *Repository) Path() string