Documentation
¶
Index ¶
- Constants
- Variables
- func IsZetaDir(dir string) bool
- func NewSingleBar(r io.Reader, total int64, current int64, oid plumbing.Hash, round int) (io.Reader, io.Closer)
- type ChangeEntry
- type Conflict
- type ConflictEntry
- type Entries
- type Entry
- type Fetcher
- type HaveObject
- type Indicators
- type MakeBar
- type MergeDriver
- type MergeOptions
- type MergeResult
- type ODB
- func (o *ODB) CountingObjects(ctx context.Context, commit, deepenFrom plumbing.Hash, maxEntries int, ...) error
- func (o *ODB) CountingSliceObjects(ctx context.Context, target plumbing.Hash, sparseDirs []string, maxEntries int, ...) error
- func (d *ODB) DecodeFragments(ctx context.Context, w io.Writer, fe *object.TreeEntry) error
- func (d *ODB) DecodeTo(ctx context.Context, w io.Writer, oid plumbing.Hash, n int64) error
- func (d *ODB) DeepenFrom() (plumbing.Hash, error)
- func (o *ODB) Delta(ctx context.Context, newRev, shallow, head plumbing.Hash) (*PushObjects, error)
- func (d *ODB) Diff3Merge(ctx context.Context, o, a, b string, labelO, labelA, labelB string) (string, bool, error)
- func (d *ODB) DoTransfer(ctx context.Context, oid plumbing.Hash, transfer Transfer, m MakeBar, ...) error
- func (d *ODB) EmptyTree() *object.Tree
- func (d *ODB) Exists(oid plumbing.Hash, metadata bool) bool
- func (d *ODB) ExternalMerge(ctx context.Context, o, a, b string, labelO, labelA, labelB string) (string, bool, error)
- func (d *ODB) Index() (i *index.Index, err error)
- func (d *ODB) LsTreeRecurse(ctx context.Context, root *object.Tree) ([]*TreeEntry, error)
- func (d *ODB) MergeTree(ctx context.Context, o, a, b *object.Tree, opts *MergeOptions) (*MergeResult, error)
- func (d *ODB) MetadataUnpack(r io.Reader, quiet bool) error
- func (d *ODB) OnReport(ctx context.Context, refname plumbing.ReferenceName, reader io.Reader) (result *Report, err error)
- func (o *ODB) ParseRevExhaustive(ctx context.Context, oid plumbing.Hash) (*object.Commit, error)
- func (d *ODB) PushTo(ctx context.Context, originWriter io.Writer, objects *PushObjects, quiet bool) error
- func (d *ODB) ResolveSpecReference(name plumbing.ReferenceName) (plumbing.Hash, error)
- func (d *ODB) Root() string
- func (d *ODB) SetIndex(idx *index.Index) (err error)
- func (d *ODB) Shallow(oid plumbing.Hash) error
- func (d *ODB) SpecReferenceRemove(name plumbing.ReferenceName) error
- func (d *ODB) SpecReferenceUpdate(name plumbing.ReferenceName, oid plumbing.Hash) error
- func (d *ODB) Unpack(r io.Reader, expected int, quiet bool) error
- func (d *ODB) Unshallow() error
- type ProgressMode
- type PushObjects
- type RenameEntry
- type Report
- type TextGetter
- type Transfer
- type TreeEntry
Constants ¶
View Source
const ( INFO_AUTO_MERGING = iota CONFLICT_CONTENTS CONFLICT_BINARY CONFLICT_FILE_DIRECTORY CONFLICT_DISTINCT_MODES CONFLICT_MODIFY_DELETE // Regular rename CONFLICT_RENAME_RENAME CONFLICT_RENAME_COLLIDES CONFLICT_RENAME_DELETE CONFLICT_DIR_RENAME_SUGGESTED INFO_DIR_RENAME_APPLIED // Special directory rename cases INFO_DIR_RENAME_SKIPPED_DUE_TO_RERENAME CONFLICT_DIR_RENAME_FILE_IN_WAY CONFLICT_DIR_RENAME_COLLISION CONFLICT_DIR_RENAME_SPLIT )
View Source
const ( MERGE_VARIANT_NORMAL = 0 MERGE_VARIANT_OURS = 1 MERGE_VARIANT_THEIRS = 2 )
View Source
const ( DefaultHashALGO = "BLAKE3" DefaultCompressionALGO = "zstd" )
View Source
const ( MERGE_HEAD plumbing.ReferenceName = "MERGE_HEAD" FETCH_HEAD plumbing.ReferenceName = "FETCH_HEAD" CHERRY_PICK_HEAD plumbing.ReferenceName = "CHERRY_PICK_HEAD" AUTO_MERGE plumbing.ReferenceName = "AUTO_MERGE" MERGE_AUTOSTASH plumbing.ReferenceName = "MERGE_AUTOSTASH" )
Variables ¶
View Source
var (
ErrNotSpecialReferenceName = errors.New("not special reference name")
)
Functions ¶
Types ¶
type ChangeEntry ¶
type Conflict ¶
type Conflict struct { // Ancestor is the conflict entry of the merge-base. Ancestor ConflictEntry `json:"ancestor"` // Our is the conflict entry of ours. Our ConflictEntry `json:"our"` // Their is the conflict entry of theirs. Their ConflictEntry `json:"their"` // Types: conflict types Types int `json:"types"` }
Conflict represents a merge conflict for a single file.
type ConflictEntry ¶
type ConflictEntry struct { // Path is the path of the conflicting file. Path string `json:"path"` // Mode is the mode of the conflicting file. Mode filemode.FileMode `json:"mode"` Hash plumbing.Hash `json:"oid"` }
ConflictEntry represents a conflict entry which is one of the sides of a conflict.
type HaveObject ¶
type Indicators ¶
type Indicators interface {
Add(int)
}
type MergeDriver ¶
type MergeOptions ¶
type MergeOptions struct { Branch1 string Branch2 string DetectRenames bool RenameLimit int RenameScore int Variant int Textconv bool MergeDriver MergeDriver TextGetter TextGetter }
type MergeResult ¶
type MergeResult struct { NewTree plumbing.Hash `json:"new-tree"` Conflicts []*Conflict `json:"conflicts,omitempty"` Messages []string `json:"messages,omitempty"` }
func (*MergeResult) Error ¶ added in v0.14.0
func (mr *MergeResult) Error() string
type ODB ¶
func (*ODB) CountingObjects ¶
func (o *ODB) CountingObjects(ctx context.Context, commit, deepenFrom plumbing.Hash, maxEntries int, fetcher Fetcher) error
CountingObjects: counting objects for current commit and parents... deepenFrom is zero --> counting all objects
func (*ODB) CountingSliceObjects ¶
func (o *ODB) CountingSliceObjects(ctx context.Context, target plumbing.Hash, sparseDirs []string, maxEntries int, fetcher Fetcher) error
CountingSliceObjects: counting all objects for current commit
func (*ODB) DecodeFragments ¶
func (*ODB) Diff3Merge ¶
func (*ODB) DoTransfer ¶
func (*ODB) ExternalMerge ¶
func (d *ODB) ExternalMerge(ctx context.Context, o, a, b string, labelO, labelA, labelB string) (string, bool, error)
ExternalMerge: use external merge tool --> aka git merge-file.
eg: git merge-file -L VERSION -L VERSION -L VERSION --no-diff3 -p VERSION.a VERSION.o VERSION.b
func (*ODB) LsTreeRecurse ¶
LsTreeRecurse: list all tree entries: merge required
func (*ODB) MergeTree ¶
func (d *ODB) MergeTree(ctx context.Context, o, a, b *object.Tree, opts *MergeOptions) (*MergeResult, error)
MergeTree: three way merge tree
func (*ODB) ParseRevExhaustive ¶
func (*ODB) ResolveSpecReference ¶
func (*ODB) SpecReferenceRemove ¶
func (d *ODB) SpecReferenceRemove(name plumbing.ReferenceName) error
func (*ODB) SpecReferenceUpdate ¶
type ProgressMode ¶
type ProgressMode int
const ( NO_BAR ProgressMode = iota SINGLE_BAR MULTI_BARS )
type PushObjects ¶
type PushObjects struct { Metadata []plumbing.Hash Objects []plumbing.Hash LargeObjects []*HaveObject }
type RenameEntry ¶
type Report ¶
type Report struct { ReferenceName plumbing.ReferenceName NewRev string Rejected bool Reason string }
type TextGetter ¶
Click to show internal directories.
Click to hide internal directories.