Documentation
¶
Index ¶
- Constants
- Variables
- func AccessRepo(ctx context.Context, access world.AccessWorldStateFunc, ref *bucket.ObjectRef, ...) (*bucket.ObjectRef, error)
- func AccessRepoWithCursor(ctx context.Context, bcs *block.Cursor, indexStore storer.IndexStorer, ...) error
- func AccessWorktree(ctx context.Context, access world.AccessWorldStateFunc, ref *bucket.ObjectRef, ...) (*bucket.ObjectRef, error)
- func AccessWorktreeWithCursor(ctx context.Context, bcs *block.Cursor, ...) error
- func AccessWorldObjectRepo(ctx context.Context, ws world.WorldState, objKey string, updateWorld bool, ...) (*bucket.ObjectRef, bool, error)
- func AccessWorldObjectRepoWithWorktree(ctx context.Context, le *logrus.Entry, ws world.WorldState, ...) error
- func AccessWorldObjectWorktree(ctx context.Context, ws world.WorldState, objKey string, updateWorld bool, ...) (*bucket.ObjectRef, bool, error)
- func CreateWorldObjectWorktree(ctx context.Context, le *logrus.Entry, ws world.WorldState, ...) error
- func GitClone(ctx context.Context, ws world.WorldState, objKey string, sender peer.ID, ...) (*bucket.ObjectRef, error)
- func GitCreateWorktree(ctx context.Context, ws world.WorldState, sender peer.ID, ...) error
- func GitFetch(ctx context.Context, ws world.WorldState, objKey string, ...) (*bucket.ObjectRef, error)
- func LookupWorktreeHead(ctx context.Context, ws world.WorldState, worktreeKey, repoKey string) (*plumbing.Reference, error)
- func NewHeadRefStoreSet(v *[]*HeadRefStore, bcs *block.Cursor) *sbset.NamedSubBlockSet
- func NewWorktreeBlock() block.Block
- func ReadRepo(ctx context.Context, access world.AccessWorldStateFunc, ref *bucket.ObjectRef, ...) error
- func ValidateOrCreateRepo(ctx context.Context, accessState world.AccessWorldStateFunc, ...) (*bucket.ObjectRef, error)
- func WorktreeLookupWorkdirRef(ctx context.Context, worldHandle world.WorldState, objKey string) (*unixfs_world.UnixfsRef, error)
- type GitCloneOp
- func (o *GitCloneOp) ApplyWorldOp(ctx context.Context, le *logrus.Entry, worldHandle world.WorldState, ...) (sysErr bool, err error)
- func (m *GitCloneOp) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *GitCloneOp) CloneVT() *GitCloneOp
- func (this *GitCloneOp) EqualMessageVT(thatMsg any) bool
- func (this *GitCloneOp) EqualVT(that *GitCloneOp) bool
- func (x *GitCloneOp) GetCloneOpts() *block.CloneOpts
- func (x *GitCloneOp) GetCreateWorktree() *GitCreateWorktreeOp
- func (x *GitCloneOp) GetDisableCheckout() bool
- func (x *GitCloneOp) GetObjectKey() string
- func (x *GitCloneOp) GetTimestamp() *timestamppb.Timestamp
- func (x *GitCloneOp) MarshalJSON() ([]byte, error)
- func (x *GitCloneOp) MarshalProtoJSON(s *json.MarshalState)
- func (x *GitCloneOp) MarshalProtoText() string
- func (m *GitCloneOp) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *GitCloneOp) MarshalToVT(dAtA []byte) (int, error)
- func (m *GitCloneOp) MarshalVT() (dAtA []byte, err error)
- func (*GitCloneOp) ProtoMessage()
- func (x *GitCloneOp) Reset()
- func (m *GitCloneOp) SizeVT() (n int)
- func (x *GitCloneOp) String() string
- func (*GitCloneOp) TypeID() string
- func (x *GitCloneOp) UnmarshalJSON(b []byte) error
- func (x *GitCloneOp) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *GitCloneOp) UnmarshalVT(dAtA []byte) error
- func (o *GitCloneOp) Validate() error
- type GitCreateWorktreeOp
- func (o *GitCreateWorktreeOp) ApplyWorldOp(ctx context.Context, le *logrus.Entry, worldHandle world.WorldState, ...) (sysErr bool, err error)
- func (m *GitCreateWorktreeOp) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *GitCreateWorktreeOp) CloneVT() *GitCreateWorktreeOp
- func (this *GitCreateWorktreeOp) EqualMessageVT(thatMsg any) bool
- func (this *GitCreateWorktreeOp) EqualVT(that *GitCreateWorktreeOp) bool
- func (x *GitCreateWorktreeOp) GetCheckoutOpts() *block.CheckoutOpts
- func (x *GitCreateWorktreeOp) GetCreateWorkdir() bool
- func (x *GitCreateWorktreeOp) GetDisableCheckout() bool
- func (x *GitCreateWorktreeOp) GetObjectKey() string
- func (x *GitCreateWorktreeOp) GetRepoObjectKey() string
- func (x *GitCreateWorktreeOp) GetTimestamp() *timestamppb.Timestamp
- func (x *GitCreateWorktreeOp) GetWorkdirRef() *world.UnixfsRef
- func (x *GitCreateWorktreeOp) MarshalJSON() ([]byte, error)
- func (x *GitCreateWorktreeOp) MarshalProtoJSON(s *json.MarshalState)
- func (x *GitCreateWorktreeOp) MarshalProtoText() string
- func (m *GitCreateWorktreeOp) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *GitCreateWorktreeOp) MarshalToVT(dAtA []byte) (int, error)
- func (m *GitCreateWorktreeOp) MarshalVT() (dAtA []byte, err error)
- func (*GitCreateWorktreeOp) ProtoMessage()
- func (x *GitCreateWorktreeOp) Reset()
- func (m *GitCreateWorktreeOp) SizeVT() (n int)
- func (x *GitCreateWorktreeOp) String() string
- func (*GitCreateWorktreeOp) TypeID() string
- func (x *GitCreateWorktreeOp) UnmarshalJSON(b []byte) error
- func (x *GitCreateWorktreeOp) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *GitCreateWorktreeOp) UnmarshalVT(dAtA []byte) error
- func (o *GitCreateWorktreeOp) Validate() error
- type GitFetchOp
- func (o *GitFetchOp) ApplyWorldOp(ctx context.Context, le *logrus.Entry, worldHandle world.WorldState, ...) (sysErr bool, err error)
- func (m *GitFetchOp) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *GitFetchOp) CloneVT() *GitFetchOp
- func (this *GitFetchOp) EqualMessageVT(thatMsg any) bool
- func (this *GitFetchOp) EqualVT(that *GitFetchOp) bool
- func (x *GitFetchOp) GetFetchOpts() *block.FetchOpts
- func (x *GitFetchOp) GetObjectKey() string
- func (x *GitFetchOp) MarshalJSON() ([]byte, error)
- func (x *GitFetchOp) MarshalProtoJSON(s *json.MarshalState)
- func (x *GitFetchOp) MarshalProtoText() string
- func (m *GitFetchOp) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *GitFetchOp) MarshalToVT(dAtA []byte) (int, error)
- func (m *GitFetchOp) MarshalVT() (dAtA []byte, err error)
- func (*GitFetchOp) ProtoMessage()
- func (x *GitFetchOp) Reset()
- func (m *GitFetchOp) SizeVT() (n int)
- func (x *GitFetchOp) String() string
- func (*GitFetchOp) TypeID() string
- func (x *GitFetchOp) UnmarshalJSON(b []byte) error
- func (x *GitFetchOp) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *GitFetchOp) UnmarshalVT(dAtA []byte) error
- func (o *GitFetchOp) Validate() error
- type GitInitOp
- func (o *GitInitOp) ApplyWorldObjectOp(ctx context.Context, le *logrus.Entry, objectHandle world.ObjectState, ...) (sysErr bool, err error)
- func (o *GitInitOp) ApplyWorldOp(ctx context.Context, le *logrus.Entry, worldHandle world.WorldState, ...) (sysErr bool, err error)
- func (m *GitInitOp) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *GitInitOp) CloneVT() *GitInitOp
- func (this *GitInitOp) EqualMessageVT(thatMsg any) bool
- func (this *GitInitOp) EqualVT(that *GitInitOp) bool
- func (x *GitInitOp) GetCreateWorktree() *GitCreateWorktreeOp
- func (x *GitInitOp) GetDisableCheckout() bool
- func (x *GitInitOp) GetObjectKey() string
- func (x *GitInitOp) GetRepoRef() *bucket.ObjectRef
- func (x *GitInitOp) GetTimestamp() *timestamppb.Timestamp
- func (x *GitInitOp) MarshalJSON() ([]byte, error)
- func (x *GitInitOp) MarshalProtoJSON(s *json.MarshalState)
- func (x *GitInitOp) MarshalProtoText() string
- func (m *GitInitOp) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *GitInitOp) MarshalToVT(dAtA []byte) (int, error)
- func (m *GitInitOp) MarshalVT() (dAtA []byte, err error)
- func (*GitInitOp) ProtoMessage()
- func (x *GitInitOp) Reset()
- func (m *GitInitOp) SizeVT() (n int)
- func (x *GitInitOp) String() string
- func (*GitInitOp) TypeID() string
- func (x *GitInitOp) UnmarshalJSON(b []byte) error
- func (x *GitInitOp) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *GitInitOp) UnmarshalVT(dAtA []byte) error
- func (o *GitInitOp) Validate() error
- type GitStageOp
- func (o *GitStageOp) ApplyWorldOp(ctx context.Context, le *logrus.Entry, worldHandle world.WorldState, ...) (sysErr bool, err error)
- func (m *GitStageOp) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *GitStageOp) CloneVT() *GitStageOp
- func (this *GitStageOp) EqualMessageVT(thatMsg any) bool
- func (this *GitStageOp) EqualVT(that *GitStageOp) bool
- func (x *GitStageOp) GetObjectKey() string
- func (x *GitStageOp) GetPaths() []string
- func (x *GitStageOp) GetRepoObjectKey() string
- func (x *GitStageOp) GetTimestamp() *timestamppb.Timestamp
- func (x *GitStageOp) MarshalJSON() ([]byte, error)
- func (x *GitStageOp) MarshalProtoJSON(s *json.MarshalState)
- func (x *GitStageOp) MarshalProtoText() string
- func (m *GitStageOp) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *GitStageOp) MarshalToVT(dAtA []byte) (int, error)
- func (m *GitStageOp) MarshalVT() (dAtA []byte, err error)
- func (*GitStageOp) ProtoMessage()
- func (x *GitStageOp) Reset()
- func (m *GitStageOp) SizeVT() (n int)
- func (x *GitStageOp) String() string
- func (*GitStageOp) TypeID() string
- func (x *GitStageOp) UnmarshalJSON(b []byte) error
- func (x *GitStageOp) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *GitStageOp) UnmarshalVT(dAtA []byte) error
- func (o *GitStageOp) Validate() error
- type GitUnstageOp
- func (o *GitUnstageOp) ApplyWorldOp(ctx context.Context, le *logrus.Entry, worldHandle world.WorldState, ...) (sysErr bool, err error)
- func (m *GitUnstageOp) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *GitUnstageOp) CloneVT() *GitUnstageOp
- func (this *GitUnstageOp) EqualMessageVT(thatMsg any) bool
- func (this *GitUnstageOp) EqualVT(that *GitUnstageOp) bool
- func (x *GitUnstageOp) GetObjectKey() string
- func (x *GitUnstageOp) GetPaths() []string
- func (x *GitUnstageOp) GetRepoObjectKey() string
- func (x *GitUnstageOp) GetTimestamp() *timestamppb.Timestamp
- func (x *GitUnstageOp) MarshalJSON() ([]byte, error)
- func (x *GitUnstageOp) MarshalProtoJSON(s *json.MarshalState)
- func (x *GitUnstageOp) MarshalProtoText() string
- func (m *GitUnstageOp) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *GitUnstageOp) MarshalToVT(dAtA []byte) (int, error)
- func (m *GitUnstageOp) MarshalVT() (dAtA []byte, err error)
- func (*GitUnstageOp) ProtoMessage()
- func (x *GitUnstageOp) Reset()
- func (m *GitUnstageOp) SizeVT() (n int)
- func (x *GitUnstageOp) String() string
- func (*GitUnstageOp) TypeID() string
- func (x *GitUnstageOp) UnmarshalJSON(b []byte) error
- func (x *GitUnstageOp) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *GitUnstageOp) UnmarshalVT(dAtA []byte) error
- func (o *GitUnstageOp) Validate() error
- type GitWorktreeCheckoutOp
- func (o *GitWorktreeCheckoutOp) ApplyWorldOp(ctx context.Context, le *logrus.Entry, worldHandle world.WorldState, ...) (sysErr bool, err error)
- func (m *GitWorktreeCheckoutOp) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *GitWorktreeCheckoutOp) CloneVT() *GitWorktreeCheckoutOp
- func (this *GitWorktreeCheckoutOp) EqualMessageVT(thatMsg any) bool
- func (this *GitWorktreeCheckoutOp) EqualVT(that *GitWorktreeCheckoutOp) bool
- func (x *GitWorktreeCheckoutOp) GetCheckoutOpts() *block.CheckoutOpts
- func (x *GitWorktreeCheckoutOp) GetObjectKey() string
- func (x *GitWorktreeCheckoutOp) GetRepoObjectKey() string
- func (x *GitWorktreeCheckoutOp) GetTimestamp() *timestamppb.Timestamp
- func (x *GitWorktreeCheckoutOp) MarshalJSON() ([]byte, error)
- func (x *GitWorktreeCheckoutOp) MarshalProtoJSON(s *json.MarshalState)
- func (x *GitWorktreeCheckoutOp) MarshalProtoText() string
- func (m *GitWorktreeCheckoutOp) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *GitWorktreeCheckoutOp) MarshalToVT(dAtA []byte) (int, error)
- func (m *GitWorktreeCheckoutOp) MarshalVT() (dAtA []byte, err error)
- func (*GitWorktreeCheckoutOp) ProtoMessage()
- func (x *GitWorktreeCheckoutOp) Reset()
- func (m *GitWorktreeCheckoutOp) SizeVT() (n int)
- func (x *GitWorktreeCheckoutOp) String() string
- func (*GitWorktreeCheckoutOp) TypeID() string
- func (x *GitWorktreeCheckoutOp) UnmarshalJSON(b []byte) error
- func (x *GitWorktreeCheckoutOp) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *GitWorktreeCheckoutOp) UnmarshalVT(dAtA []byte) error
- func (o *GitWorktreeCheckoutOp) Validate() error
- type HeadRefStore
- func (h *HeadRefStore) BlockAliasIdentity() *block.AliasIdentityToken
- func (h *HeadRefStore) ClearSubmoduleStore(bcs *block.Cursor, name string) error
- func (m *HeadRefStore) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *HeadRefStore) CloneVT() *HeadRefStore
- func (this *HeadRefStore) EqualMessageVT(thatMsg any) bool
- func (this *HeadRefStore) EqualVT(that *HeadRefStore) bool
- func (x *HeadRefStore) GetHeadRef() *block.Reference
- func (h *HeadRefStore) GetName() string
- func (h *HeadRefStore) GetReference(ref plumbing.ReferenceName) (*plumbing.Reference, error)
- func (x *HeadRefStore) GetSubmoduleName() string
- func (h *HeadRefStore) GetSubmoduleStore(bcs *block.Cursor, name string) (*HeadRefStore, *block.Cursor, error)
- func (x *HeadRefStore) GetSubmodules() []*HeadRefStore
- func (h *HeadRefStore) IsNil() bool
- func (x *HeadRefStore) MarshalJSON() ([]byte, error)
- func (x *HeadRefStore) MarshalProtoJSON(s *json.MarshalState)
- func (x *HeadRefStore) MarshalProtoText() string
- func (m *HeadRefStore) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *HeadRefStore) MarshalToVT(dAtA []byte) (int, error)
- func (m *HeadRefStore) MarshalVT() (dAtA []byte, err error)
- func (*HeadRefStore) ProtoMessage()
- func (x *HeadRefStore) Reset()
- func (h *HeadRefStore) SetReference(bcs *block.Cursor, ref *plumbing.Reference) (set bool, err error)
- func (m *HeadRefStore) SizeVT() (n int)
- func (x *HeadRefStore) String() string
- func (x *HeadRefStore) UnmarshalJSON(b []byte) error
- func (x *HeadRefStore) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *HeadRefStore) UnmarshalVT(dAtA []byte) error
- func (h *HeadRefStore) Validate() error
- type HeadRefStoreCursor
- func (r *HeadRefStoreCursor) ClearSubmoduleStore(name string) error
- func (r *HeadRefStoreCursor) GetReference(ref plumbing.ReferenceName) (*plumbing.Reference, error)
- func (r *HeadRefStoreCursor) GetSubmoduleStore(name string) (git_block.ReferenceStore, error)
- func (r *HeadRefStoreCursor) SetReference(ref *plumbing.Reference) (set bool, err error)
- type Worktree
- func (r *Worktree) ApplySubBlock(id uint32, next block.SubBlock) error
- func (m *Worktree) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *Worktree) CloneVT() *Worktree
- func (this *Worktree) EqualMessageVT(thatMsg any) bool
- func (this *Worktree) EqualVT(that *Worktree) bool
- func (r *Worktree) FollowHeadRefStore(bcs *block.Cursor) (*HeadRefStoreCursor, error)
- func (x *Worktree) GetGitIndex() *block.Index
- func (x *Worktree) GetHeadRefStore() *HeadRefStore
- func (r *Worktree) GetSubBlockCtor(id uint32) block.SubBlockCtor
- func (r *Worktree) GetSubBlocks() map[uint32]block.SubBlock
- func (r *Worktree) Index() (*index.Index, error)
- func (x *Worktree) MarshalJSON() ([]byte, error)
- func (x *Worktree) MarshalProtoJSON(s *json.MarshalState)
- func (x *Worktree) MarshalProtoText() string
- func (m *Worktree) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Worktree) MarshalToVT(dAtA []byte) (int, error)
- func (m *Worktree) MarshalVT() (dAtA []byte, err error)
- func (*Worktree) ProtoMessage()
- func (x *Worktree) Reset()
- func (r *Worktree) SetIndex(i *index.Index) error
- func (m *Worktree) SizeVT() (n int)
- func (x *Worktree) String() string
- func (*Worktree) TypeID() string
- func (x *Worktree) UnmarshalJSON(b []byte) error
- func (x *Worktree) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *Worktree) UnmarshalVT(dAtA []byte) error
- func (r *Worktree) Validate() error
Constants ¶
const ( // GitRepoTypeID is the type identifier for a git repo. GitRepoTypeID = git_block.RepoTypeID // GitRepoWorktreePred is the predicate pointing to the worktree. GitRepoWorktreePred = "git/worktree" // GitWorktreeWorkdirPred is the predicate pointing to the workdir. GitWorktreeWorkdirPred = "git/workdir" // GitRepoPred is the predicate pointing to a repo. GitRepoPred = "git/repo" )
const GitCloneOpTypeID = "hydra/git/clone"
GitCloneOpTypeID is the type ID of GitCloneOp.
const GitCreateWorktreeOpTypeID = "hydra/git/create-worktree"
GitCreateWorktreeOpTypeID is the type ID of GitCreateWorktreeOp.
const GitFetchOpTypeID = "hydra/git/fetch"
GitFetchOpTypeID is the type ID of GitFetchOp.
const GitInitOpTypeID = "hydra/git/init"
GitInitOpTypeID is the type ID of GitInitOp.
const GitStageOpTypeID = "hydra/git/stage"
GitStageOpTypeID is the type ID of GitStageOp.
const GitUnstageOpTypeID = "hydra/git/unstage"
GitUnstageOpTypeID is the type ID of GitUnstageOp.
const GitWorktreeCheckoutOpTypeID = "hydra/git/worktree/checkout"
GitWorktreeCheckoutOpTypeID is the type ID of GitWorktreeCheckoutOp.
const WorktreeTypeID = "git/worktree"
WorktreeTypeID is the type ID of Worktree.
Variables ¶
var GitTypes = []typeid.Type{ {ID: GitInitOpTypeID, New: func() any { return new(GitInitOp) }}, {ID: WorktreeTypeID, New: func() any { return new(Worktree) }}, {ID: GitCreateWorktreeOpTypeID, New: func() any { return new(GitCreateWorktreeOp) }}, {ID: GitFetchOpTypeID, New: func() any { return new(GitFetchOp) }}, {ID: GitCloneOpTypeID, New: func() any { return new(GitCloneOp) }}, {ID: GitWorktreeCheckoutOpTypeID, New: func() any { return new(GitWorktreeCheckoutOp) }}, {ID: GitStageOpTypeID, New: func() any { return new(GitStageOp) }}, {ID: GitUnstageOpTypeID, New: func() any { return new(GitUnstageOp) }}, }
GitTypes lists the typed messages of git.proto.
Functions ¶
func AccessRepo ¶
func AccessRepo( ctx context.Context, access world.AccessWorldStateFunc, ref *bucket.ObjectRef, indexStore storer.IndexStorer, workdir billy.Filesystem, refStore git_block.ReferenceStore, cb func(repo *git.Repository) error, ) (*bucket.ObjectRef, error)
AccessRepo is a utility for AccessWorldState to access a repository. Ref can be nil to indicate creating a new repo. The block transaction is written upon completion and updated ObjectRef returned.
configStore, indexStore, and worktree can be empty to use a default in-mem store. Returns the updated object ref and any error.
func AccessRepoWithCursor ¶
func AccessRepoWithCursor( ctx context.Context, bcs *block.Cursor, indexStore storer.IndexStorer, workdir billy.Filesystem, refStore git_block.ReferenceStore, cb func(repo *git.Repository) error, ) error
AccessRepoWithCursor accesses a repo reading / writing to a block cursor.
setHeadCb is an optional callback to override updating HEAD.
func AccessWorktree ¶
func AccessWorktree( ctx context.Context, access world.AccessWorldStateFunc, ref *bucket.ObjectRef, cb func(bcs *block.Cursor, wt *Worktree) error, ) (*bucket.ObjectRef, error)
AccessWorktree is a utility for AccessWorldState to access a worktree. Ref can be nil to indicate creating a new worktree. The block transaction is written upon completion and updated ObjectRef returned.
func AccessWorktreeWithCursor ¶
func AccessWorktreeWithCursor( ctx context.Context, bcs *block.Cursor, cb func(bcs *block.Cursor, wt *Worktree) error, ) error
AccessWorktreeWithCursor accesses a Worktree reading / writing to a block cursor.
func AccessWorldObjectRepo ¶
func AccessWorldObjectRepo( ctx context.Context, ws world.WorldState, objKey string, updateWorld bool, indexStore storer.IndexStorer, workdir billy.Filesystem, refStore git_block.ReferenceStore, cb func(repo *git.Repository) error, ) (*bucket.ObjectRef, bool, error)
AccessWorldObjectRepo attempts to look up a Repo in the world state. If the object did not exist, bcs will be empty, the object will be created. If updateWorld=true, and the result is different, will SetRootRef with change. Note: if updateWorld=true but ws is read-only, sets updateWorld=false. Returns the modified object ref, if it was stored, and any error. refStore can be nil.
func AccessWorldObjectRepoWithWorktree ¶
func AccessWorldObjectRepoWithWorktree( ctx context.Context, le *logrus.Entry, ws world.WorldState, repoObjKey, worktreeObjKey string, ts time.Time, updateWorld bool, sender peer.ID, cb func(repo *git.Repository, workDir billy.Filesystem) error, ) error
AccessWorldObjectRepoWithWorktree accesses a repository with a worktree.
func AccessWorldObjectWorktree ¶
func AccessWorldObjectWorktree( ctx context.Context, ws world.WorldState, objKey string, updateWorld bool, workdir billy.Filesystem, cb func(bcs *block.Cursor, wt *Worktree) error, ) (*bucket.ObjectRef, bool, error)
AccessWorldObjectWorktree attempts to look up a Worktree in the world state. If the object did not exist, bcs will be empty, the object will be created. If updateWorld=true, and the result is different, will SetRootRef with change. Note: if updateWorld=true but ws is read-only, sets updateWorld=false. Returns the modified object ref, if it was stored, and any error.
func CreateWorldObjectWorktree ¶
func CreateWorldObjectWorktree( ctx context.Context, le *logrus.Entry, ws world.WorldState, worktreeObjKey, repoObjKey string, workdirRef *unixfs_world.UnixfsRef, createWorkdir bool, checkoutOpts *git.CheckoutOptions, sender peer.ID, ts time.Time, ) error
CreateWorldObjectWorktree creates a worktree attached to a workdir and repo.
le can be nil if checkoutOpts is nil, skips checkout
func GitClone ¶
func GitClone( ctx context.Context, ws world.WorldState, objKey string, sender peer.ID, cloneOpts *git_block.CloneOpts, authMethod client.SSHAuth, progress sideband.Progress, worktreeArgs *GitCreateWorktreeOp, ts *timestamppb.Timestamp, ) (*bucket.ObjectRef, error)
GitClone performs a git clone operation against a world. Clones the repo directly into a bulk-mode hydra Store. Objects stream to KV via per-object mini-transactions during the clone, and the IAVL tree is built bottom-up at commit time. If DisableCheckout is set, disables creating the worktree. Returns the object ref to the Repo. authMethod, progress, worktreeArgs, ts can be empty.
func GitCreateWorktree ¶
func GitCreateWorktree( ctx context.Context, ws world.WorldState, sender peer.ID, objKey, repoObjKey string, workdirRef *unixfs_world.UnixfsRef, createWorkdir bool, checkoutOpts *git_block.CheckoutOpts, disableCheckout bool, ts time.Time, ) error
GitCreateWorktree creates a new git worktree attached to a repo and workdir.
func GitFetch ¶
func GitFetch( ctx context.Context, ws world.WorldState, objKey string, fetchOpts *git_block.FetchOpts, authMethod client.SSHAuth, progress sideband.Progress, ) (*bucket.ObjectRef, error)
GitFetch performs a git fetch operation against an existing repo in the world. Fetches new objects from the remote into the existing world object repo and returns the repo's root reference after the fetch. authMethod and progress can be empty.
func LookupWorktreeHead ¶
func LookupWorktreeHead(ctx context.Context, ws world.WorldState, worktreeKey, repoKey string) (*plumbing.Reference, error)
LookupWorktreeHead returns the checked-out reference of the worktree object at worktreeKey, resolved to a commit in the repository object at repoKey. The reference is named by the checked-out branch, or HEAD when detached. Returns nil when the worktree has no commit checked out.
func NewHeadRefStoreSet ¶
func NewHeadRefStoreSet(v *[]*HeadRefStore, bcs *block.Cursor) *sbset.NamedSubBlockSet
NewHeadRefStoreSet builds a new head ref store set container.
bcs should be located at the world change set sub-block.
func NewWorktreeBlock ¶
NewWorktreeBlock builds a new repo root block.
func ReadRepo ¶
func ReadRepo( ctx context.Context, access world.AccessWorldStateFunc, ref *bucket.ObjectRef, cb func(repo *git.Repository) error, ) error
ReadRepo opens the repository at ref for reading. Nothing is written: block changes made while opening the repository, such as initializing a missing HEAD the way AccessRepo does, are discarded, so read-only World storage can serve the read.
func ValidateOrCreateRepo ¶
func ValidateOrCreateRepo( ctx context.Context, accessState world.AccessWorldStateFunc, repoRef *bucket.ObjectRef, ) (*bucket.ObjectRef, error)
ValidateOrCreateRepo creates or checks a reference to a Repo. repoRef can be nil to create a new repo. A new repo is initialized with its HEAD, so later reads open it without writing.
func WorktreeLookupWorkdirRef ¶
func WorktreeLookupWorkdirRef( ctx context.Context, worldHandle world.WorldState, objKey string, ) (*unixfs_world.UnixfsRef, error)
WorktreeLookupWorkdirRef looks up the unixfs ref to the workdir from graph quads.
Types ¶
type GitCloneOp ¶
type GitCloneOp struct {
// ObjectKey is the object key to create as a Repo.
ObjectKey string `protobuf:"bytes,1,opt,name=object_key,json=objectKey,proto3" json:"objectKey,omitempty"`
// CloneOpts contains the clone options (URL, ref, etc).
CloneOpts *block.CloneOpts `protobuf:"bytes,2,opt,name=clone_opts,json=cloneOpts,proto3" json:"cloneOpts,omitempty"`
// DisableCheckout disables creating a worktree after clone.
DisableCheckout bool `protobuf:"varint,3,opt,name=disable_checkout,json=disableCheckout,proto3" json:"disableCheckout,omitempty"`
// CreateWorktree configures creating the worktree.
// If unset, uses object_key + "/worktree"
// If disable_checkout is set, worktree is not created.
CreateWorktree *GitCreateWorktreeOp `protobuf:"bytes,4,opt,name=create_worktree,json=createWorktree,proto3" json:"createWorktree,omitempty"`
// Timestamp is the modification time for the workdir ops.
// Passed to GitInitOp when creating the repo.
Timestamp *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
// contains filtered or unexported fields
}
GitCloneOp is an operation to clone a git repo into the world. Clones objects from a remote, then runs GitInitOp to register the repo.
func NewGitCloneOp ¶
func NewGitCloneOp(op *GitCloneOp) *GitCloneOp
NewGitCloneOp constructs a new GitCloneOp.
func (*GitCloneOp) ApplyWorldOp ¶
func (o *GitCloneOp) ApplyWorldOp( ctx context.Context, le *logrus.Entry, worldHandle world.WorldState, sender peer.ID, ) (sysErr bool, err error)
ApplyWorldOp applies the operation as a world operation.
func (*GitCloneOp) CloneMessageVT ¶
func (m *GitCloneOp) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*GitCloneOp) CloneVT ¶
func (m *GitCloneOp) CloneVT() *GitCloneOp
func (*GitCloneOp) EqualMessageVT ¶
func (this *GitCloneOp) EqualMessageVT(thatMsg any) bool
func (*GitCloneOp) EqualVT ¶
func (this *GitCloneOp) EqualVT(that *GitCloneOp) bool
func (*GitCloneOp) GetCloneOpts ¶
func (x *GitCloneOp) GetCloneOpts() *block.CloneOpts
func (*GitCloneOp) GetCreateWorktree ¶
func (x *GitCloneOp) GetCreateWorktree() *GitCreateWorktreeOp
func (*GitCloneOp) GetDisableCheckout ¶
func (x *GitCloneOp) GetDisableCheckout() bool
func (*GitCloneOp) GetObjectKey ¶
func (x *GitCloneOp) GetObjectKey() string
func (*GitCloneOp) GetTimestamp ¶
func (x *GitCloneOp) GetTimestamp() *timestamppb.Timestamp
func (*GitCloneOp) MarshalJSON ¶
func (x *GitCloneOp) MarshalJSON() ([]byte, error)
MarshalJSON marshals the GitCloneOp to JSON.
func (*GitCloneOp) MarshalProtoJSON ¶
func (x *GitCloneOp) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the GitCloneOp message to JSON.
func (*GitCloneOp) MarshalProtoText ¶
func (x *GitCloneOp) MarshalProtoText() string
func (*GitCloneOp) MarshalToSizedBufferVT ¶
func (m *GitCloneOp) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*GitCloneOp) MarshalToVT ¶
func (m *GitCloneOp) MarshalToVT(dAtA []byte) (int, error)
func (*GitCloneOp) MarshalVT ¶
func (m *GitCloneOp) MarshalVT() (dAtA []byte, err error)
func (*GitCloneOp) ProtoMessage ¶
func (*GitCloneOp) ProtoMessage()
func (*GitCloneOp) Reset ¶
func (x *GitCloneOp) Reset()
func (*GitCloneOp) SizeVT ¶
func (m *GitCloneOp) SizeVT() (n int)
func (*GitCloneOp) String ¶
func (x *GitCloneOp) String() string
func (*GitCloneOp) TypeID ¶
func (*GitCloneOp) TypeID() string
TypeID returns the type ID of GitCloneOp.
func (*GitCloneOp) UnmarshalJSON ¶
func (x *GitCloneOp) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the GitCloneOp from JSON.
func (*GitCloneOp) UnmarshalProtoJSON ¶
func (x *GitCloneOp) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the GitCloneOp message from JSON.
func (*GitCloneOp) UnmarshalVT ¶
func (m *GitCloneOp) UnmarshalVT(dAtA []byte) error
func (*GitCloneOp) Validate ¶
func (o *GitCloneOp) Validate() error
Validate checks the clone operation.
type GitCreateWorktreeOp ¶
type GitCreateWorktreeOp struct {
// ObjectKey is the object key to create as a Worktree.
ObjectKey string `protobuf:"bytes,1,opt,name=object_key,json=objectKey,proto3" json:"objectKey,omitempty"`
// RepoObjectKey is the key of the repository object.
RepoObjectKey string `protobuf:"bytes,2,opt,name=repo_object_key,json=repoObjectKey,proto3" json:"repoObjectKey,omitempty"`
// WorkdirRef is a unixfs reference to the workdir.
WorkdirRef *world.UnixfsRef `protobuf:"bytes,3,opt,name=workdir_ref,json=workdirRef,proto3" json:"workdirRef,omitempty"`
// CreateWorkdir indicates to create the workdir if it doesn't exist.
CreateWorkdir bool `protobuf:"varint,4,opt,name=create_workdir,json=createWorkdir,proto3" json:"createWorkdir,omitempty"`
// CheckoutOpts are options to use when checking out the data.
CheckoutOpts *block.CheckoutOpts `protobuf:"bytes,5,opt,name=checkout_opts,json=checkoutOpts,proto3" json:"checkoutOpts,omitempty"`
// DisableCheckout disables checking out the data to the workdir.
DisableCheckout bool `protobuf:"varint,6,opt,name=disable_checkout,json=disableCheckout,proto3" json:"disableCheckout,omitempty"`
// Timestamp is the modification time for the workdir ops.
Timestamp *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
// contains filtered or unexported fields
}
GitCreateWorktreeOp creates a Git worktree attached to a Repo. Note: cannot be run as a Object-specific op.
func NewGitCreateWorktreeOp ¶
func NewGitCreateWorktreeOp( objKey string, repoObjKey string, workdirRef *unixfs_world.UnixfsRef, createWorkdir bool, checkoutOpts *git_block.CheckoutOpts, disableCheckout bool, ts time.Time, ) *GitCreateWorktreeOp
NewGitCreateWorktreeOp constructs a new GitCreateWorktreeOp block. workdirObjKey, workdirPath, and ref can be empty.
func (*GitCreateWorktreeOp) ApplyWorldOp ¶
func (o *GitCreateWorktreeOp) ApplyWorldOp( ctx context.Context, le *logrus.Entry, worldHandle world.WorldState, sender peer.ID, ) (sysErr bool, err error)
ApplyWorldOp applies the operation as a world operation.
func (*GitCreateWorktreeOp) CloneMessageVT ¶
func (m *GitCreateWorktreeOp) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*GitCreateWorktreeOp) CloneVT ¶
func (m *GitCreateWorktreeOp) CloneVT() *GitCreateWorktreeOp
func (*GitCreateWorktreeOp) EqualMessageVT ¶
func (this *GitCreateWorktreeOp) EqualMessageVT(thatMsg any) bool
func (*GitCreateWorktreeOp) EqualVT ¶
func (this *GitCreateWorktreeOp) EqualVT(that *GitCreateWorktreeOp) bool
func (*GitCreateWorktreeOp) GetCheckoutOpts ¶
func (x *GitCreateWorktreeOp) GetCheckoutOpts() *block.CheckoutOpts
func (*GitCreateWorktreeOp) GetCreateWorkdir ¶
func (x *GitCreateWorktreeOp) GetCreateWorkdir() bool
func (*GitCreateWorktreeOp) GetDisableCheckout ¶
func (x *GitCreateWorktreeOp) GetDisableCheckout() bool
func (*GitCreateWorktreeOp) GetObjectKey ¶
func (x *GitCreateWorktreeOp) GetObjectKey() string
func (*GitCreateWorktreeOp) GetRepoObjectKey ¶
func (x *GitCreateWorktreeOp) GetRepoObjectKey() string
func (*GitCreateWorktreeOp) GetTimestamp ¶
func (x *GitCreateWorktreeOp) GetTimestamp() *timestamppb.Timestamp
func (*GitCreateWorktreeOp) GetWorkdirRef ¶
func (x *GitCreateWorktreeOp) GetWorkdirRef() *world.UnixfsRef
func (*GitCreateWorktreeOp) MarshalJSON ¶
func (x *GitCreateWorktreeOp) MarshalJSON() ([]byte, error)
MarshalJSON marshals the GitCreateWorktreeOp to JSON.
func (*GitCreateWorktreeOp) MarshalProtoJSON ¶
func (x *GitCreateWorktreeOp) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the GitCreateWorktreeOp message to JSON.
func (*GitCreateWorktreeOp) MarshalProtoText ¶
func (x *GitCreateWorktreeOp) MarshalProtoText() string
func (*GitCreateWorktreeOp) MarshalToSizedBufferVT ¶
func (m *GitCreateWorktreeOp) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*GitCreateWorktreeOp) MarshalToVT ¶
func (m *GitCreateWorktreeOp) MarshalToVT(dAtA []byte) (int, error)
func (*GitCreateWorktreeOp) MarshalVT ¶
func (m *GitCreateWorktreeOp) MarshalVT() (dAtA []byte, err error)
func (*GitCreateWorktreeOp) ProtoMessage ¶
func (*GitCreateWorktreeOp) ProtoMessage()
func (*GitCreateWorktreeOp) Reset ¶
func (x *GitCreateWorktreeOp) Reset()
func (*GitCreateWorktreeOp) SizeVT ¶
func (m *GitCreateWorktreeOp) SizeVT() (n int)
func (*GitCreateWorktreeOp) String ¶
func (x *GitCreateWorktreeOp) String() string
func (*GitCreateWorktreeOp) TypeID ¶
func (*GitCreateWorktreeOp) TypeID() string
TypeID returns the type ID of GitCreateWorktreeOp.
func (*GitCreateWorktreeOp) UnmarshalJSON ¶
func (x *GitCreateWorktreeOp) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the GitCreateWorktreeOp from JSON.
func (*GitCreateWorktreeOp) UnmarshalProtoJSON ¶
func (x *GitCreateWorktreeOp) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the GitCreateWorktreeOp message from JSON.
func (*GitCreateWorktreeOp) UnmarshalVT ¶
func (m *GitCreateWorktreeOp) UnmarshalVT(dAtA []byte) error
func (*GitCreateWorktreeOp) Validate ¶
func (o *GitCreateWorktreeOp) Validate() error
Validate checks the create worktree operation.
type GitFetchOp ¶
type GitFetchOp struct {
// ObjectKey is the object key of the existing Repo to fetch into.
ObjectKey string `protobuf:"bytes,1,opt,name=object_key,json=objectKey,proto3" json:"objectKey,omitempty"`
// FetchOpts contains the fetch options.
FetchOpts *block.FetchOpts `protobuf:"bytes,2,opt,name=fetch_opts,json=fetchOpts,proto3" json:"fetchOpts,omitempty"`
// contains filtered or unexported fields
}
GitFetchOp is an operation to fetch updates into an existing repo.
func NewGitFetchOp ¶
func NewGitFetchOp(objKey string, fetchOpts *git_block.FetchOpts) *GitFetchOp
NewGitFetchOp constructs a new GitFetchOp.
func (*GitFetchOp) ApplyWorldOp ¶
func (o *GitFetchOp) ApplyWorldOp( ctx context.Context, le *logrus.Entry, worldHandle world.WorldState, sender peer.ID, ) (sysErr bool, err error)
ApplyWorldOp applies the operation as a world operation.
func (*GitFetchOp) CloneMessageVT ¶
func (m *GitFetchOp) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*GitFetchOp) CloneVT ¶
func (m *GitFetchOp) CloneVT() *GitFetchOp
func (*GitFetchOp) EqualMessageVT ¶
func (this *GitFetchOp) EqualMessageVT(thatMsg any) bool
func (*GitFetchOp) EqualVT ¶
func (this *GitFetchOp) EqualVT(that *GitFetchOp) bool
func (*GitFetchOp) GetFetchOpts ¶
func (x *GitFetchOp) GetFetchOpts() *block.FetchOpts
func (*GitFetchOp) GetObjectKey ¶
func (x *GitFetchOp) GetObjectKey() string
func (*GitFetchOp) MarshalJSON ¶
func (x *GitFetchOp) MarshalJSON() ([]byte, error)
MarshalJSON marshals the GitFetchOp to JSON.
func (*GitFetchOp) MarshalProtoJSON ¶
func (x *GitFetchOp) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the GitFetchOp message to JSON.
func (*GitFetchOp) MarshalProtoText ¶
func (x *GitFetchOp) MarshalProtoText() string
func (*GitFetchOp) MarshalToSizedBufferVT ¶
func (m *GitFetchOp) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*GitFetchOp) MarshalToVT ¶
func (m *GitFetchOp) MarshalToVT(dAtA []byte) (int, error)
func (*GitFetchOp) MarshalVT ¶
func (m *GitFetchOp) MarshalVT() (dAtA []byte, err error)
func (*GitFetchOp) ProtoMessage ¶
func (*GitFetchOp) ProtoMessage()
func (*GitFetchOp) Reset ¶
func (x *GitFetchOp) Reset()
func (*GitFetchOp) SizeVT ¶
func (m *GitFetchOp) SizeVT() (n int)
func (*GitFetchOp) String ¶
func (x *GitFetchOp) String() string
func (*GitFetchOp) TypeID ¶
func (*GitFetchOp) TypeID() string
TypeID returns the type ID of GitFetchOp.
func (*GitFetchOp) UnmarshalJSON ¶
func (x *GitFetchOp) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the GitFetchOp from JSON.
func (*GitFetchOp) UnmarshalProtoJSON ¶
func (x *GitFetchOp) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the GitFetchOp message from JSON.
func (*GitFetchOp) UnmarshalVT ¶
func (m *GitFetchOp) UnmarshalVT(dAtA []byte) error
func (*GitFetchOp) Validate ¶
func (o *GitFetchOp) Validate() error
Validate checks the fetch operation.
type GitInitOp ¶
type GitInitOp struct {
// ObjectKey is the object key to create as a Repo.
ObjectKey string `protobuf:"bytes,1,opt,name=object_key,json=objectKey,proto3" json:"objectKey,omitempty"`
// RepoRef contains the object ref to the Repo.
// If empty, will create a new blank Repo.
RepoRef *bucket.ObjectRef `protobuf:"bytes,2,opt,name=repo_ref,json=repoRef,proto3" json:"repoRef,omitempty"`
// DisableCheckout disables creating a worktree.
DisableCheckout bool `protobuf:"varint,3,opt,name=disable_checkout,json=disableCheckout,proto3" json:"disableCheckout,omitempty"`
// CreateWorktree configures creating the worktree.
// If unset, uses object_key + "/worktree"
// If disable_checkout is set, worktree is not created.
// Applying as an object op implies disable_checkout.
CreateWorktree *GitCreateWorktreeOp `protobuf:"bytes,4,opt,name=create_worktree,json=createWorktree,proto3" json:"createWorktree,omitempty"`
// Timestamp is the modification time for the workdir ops.
// Used when creating a default worktree.
Timestamp *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
// contains filtered or unexported fields
}
GitInitOp is an operation to create a repo with a root ref or empty. If applied as an object op, skips checkout step.
func NewGitInitOp ¶
func NewGitInitOp( objKey string, repoRef *bucket.ObjectRef, disableCheckout bool, worktreeArgs *GitCreateWorktreeOp, ts *timestamppb.Timestamp, ) *GitInitOp
NewGitInitOp constructs a new GitInitOp block. repoRef, worktreeArgs, ts can be empty
func (*GitInitOp) ApplyWorldObjectOp ¶
func (o *GitInitOp) ApplyWorldObjectOp( ctx context.Context, le *logrus.Entry, objectHandle world.ObjectState, sender peer.ID, ) (sysErr bool, err error)
ApplyWorldObjectOp applies the operation to a world object handle.
func (*GitInitOp) ApplyWorldOp ¶
func (o *GitInitOp) ApplyWorldOp( ctx context.Context, le *logrus.Entry, worldHandle world.WorldState, sender peer.ID, ) (sysErr bool, err error)
ApplyWorldOp applies the operation as a world operation.
func (*GitInitOp) CloneMessageVT ¶
func (m *GitInitOp) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*GitInitOp) EqualMessageVT ¶
func (*GitInitOp) GetCreateWorktree ¶
func (x *GitInitOp) GetCreateWorktree() *GitCreateWorktreeOp
func (*GitInitOp) GetDisableCheckout ¶
func (*GitInitOp) GetObjectKey ¶
func (*GitInitOp) GetRepoRef ¶
func (*GitInitOp) GetTimestamp ¶
func (x *GitInitOp) GetTimestamp() *timestamppb.Timestamp
func (*GitInitOp) MarshalJSON ¶
MarshalJSON marshals the GitInitOp to JSON.
func (*GitInitOp) MarshalProtoJSON ¶
func (x *GitInitOp) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the GitInitOp message to JSON.
func (*GitInitOp) MarshalProtoText ¶
func (*GitInitOp) MarshalToSizedBufferVT ¶
func (*GitInitOp) ProtoMessage ¶
func (*GitInitOp) ProtoMessage()
func (*GitInitOp) UnmarshalJSON ¶
UnmarshalJSON unmarshals the GitInitOp from JSON.
func (*GitInitOp) UnmarshalProtoJSON ¶
func (x *GitInitOp) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the GitInitOp message from JSON.
func (*GitInitOp) UnmarshalVT ¶
type GitStageOp ¶
type GitStageOp struct {
// ObjectKey is the object key of the Worktree.
ObjectKey string `protobuf:"bytes,1,opt,name=object_key,json=objectKey,proto3" json:"objectKey,omitempty"`
// RepoObjectKey is the key of the repository object.
RepoObjectKey string `protobuf:"bytes,2,opt,name=repo_object_key,json=repoObjectKey,proto3" json:"repoObjectKey,omitempty"`
// Paths is the list of file paths to stage.
Paths []string `protobuf:"bytes,3,rep,name=paths,proto3" json:"paths,omitempty"`
// Timestamp is the modification time for the workdir ops.
Timestamp *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
// contains filtered or unexported fields
}
GitStageOp stages files in a worktree's git index.
func (*GitStageOp) ApplyWorldOp ¶
func (o *GitStageOp) ApplyWorldOp( ctx context.Context, le *logrus.Entry, worldHandle world.WorldState, sender peer.ID, ) (sysErr bool, err error)
ApplyWorldOp applies the operation as a world operation.
func (*GitStageOp) CloneMessageVT ¶
func (m *GitStageOp) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*GitStageOp) CloneVT ¶
func (m *GitStageOp) CloneVT() *GitStageOp
func (*GitStageOp) EqualMessageVT ¶
func (this *GitStageOp) EqualMessageVT(thatMsg any) bool
func (*GitStageOp) EqualVT ¶
func (this *GitStageOp) EqualVT(that *GitStageOp) bool
func (*GitStageOp) GetObjectKey ¶
func (x *GitStageOp) GetObjectKey() string
func (*GitStageOp) GetPaths ¶
func (x *GitStageOp) GetPaths() []string
func (*GitStageOp) GetRepoObjectKey ¶
func (x *GitStageOp) GetRepoObjectKey() string
func (*GitStageOp) GetTimestamp ¶
func (x *GitStageOp) GetTimestamp() *timestamppb.Timestamp
func (*GitStageOp) MarshalJSON ¶
func (x *GitStageOp) MarshalJSON() ([]byte, error)
MarshalJSON marshals the GitStageOp to JSON.
func (*GitStageOp) MarshalProtoJSON ¶
func (x *GitStageOp) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the GitStageOp message to JSON.
func (*GitStageOp) MarshalProtoText ¶
func (x *GitStageOp) MarshalProtoText() string
func (*GitStageOp) MarshalToSizedBufferVT ¶
func (m *GitStageOp) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*GitStageOp) MarshalToVT ¶
func (m *GitStageOp) MarshalToVT(dAtA []byte) (int, error)
func (*GitStageOp) MarshalVT ¶
func (m *GitStageOp) MarshalVT() (dAtA []byte, err error)
func (*GitStageOp) ProtoMessage ¶
func (*GitStageOp) ProtoMessage()
func (*GitStageOp) Reset ¶
func (x *GitStageOp) Reset()
func (*GitStageOp) SizeVT ¶
func (m *GitStageOp) SizeVT() (n int)
func (*GitStageOp) String ¶
func (x *GitStageOp) String() string
func (*GitStageOp) TypeID ¶
func (*GitStageOp) TypeID() string
TypeID returns the type ID of GitStageOp.
func (*GitStageOp) UnmarshalJSON ¶
func (x *GitStageOp) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the GitStageOp from JSON.
func (*GitStageOp) UnmarshalProtoJSON ¶
func (x *GitStageOp) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the GitStageOp message from JSON.
func (*GitStageOp) UnmarshalVT ¶
func (m *GitStageOp) UnmarshalVT(dAtA []byte) error
func (*GitStageOp) Validate ¶
func (o *GitStageOp) Validate() error
Validate checks the stage operation.
type GitUnstageOp ¶
type GitUnstageOp struct {
// ObjectKey is the object key of the Worktree.
ObjectKey string `protobuf:"bytes,1,opt,name=object_key,json=objectKey,proto3" json:"objectKey,omitempty"`
// RepoObjectKey is the key of the repository object.
RepoObjectKey string `protobuf:"bytes,2,opt,name=repo_object_key,json=repoObjectKey,proto3" json:"repoObjectKey,omitempty"`
// Paths is the list of file paths to unstage.
Paths []string `protobuf:"bytes,3,rep,name=paths,proto3" json:"paths,omitempty"`
// Timestamp is the modification time for the workdir ops.
Timestamp *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
// contains filtered or unexported fields
}
GitUnstageOp unstages files from a worktree's git index.
func (*GitUnstageOp) ApplyWorldOp ¶
func (o *GitUnstageOp) ApplyWorldOp( ctx context.Context, le *logrus.Entry, worldHandle world.WorldState, sender peer.ID, ) (sysErr bool, err error)
ApplyWorldOp applies the operation as a world operation.
func (*GitUnstageOp) CloneMessageVT ¶
func (m *GitUnstageOp) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*GitUnstageOp) CloneVT ¶
func (m *GitUnstageOp) CloneVT() *GitUnstageOp
func (*GitUnstageOp) EqualMessageVT ¶
func (this *GitUnstageOp) EqualMessageVT(thatMsg any) bool
func (*GitUnstageOp) EqualVT ¶
func (this *GitUnstageOp) EqualVT(that *GitUnstageOp) bool
func (*GitUnstageOp) GetObjectKey ¶
func (x *GitUnstageOp) GetObjectKey() string
func (*GitUnstageOp) GetPaths ¶
func (x *GitUnstageOp) GetPaths() []string
func (*GitUnstageOp) GetRepoObjectKey ¶
func (x *GitUnstageOp) GetRepoObjectKey() string
func (*GitUnstageOp) GetTimestamp ¶
func (x *GitUnstageOp) GetTimestamp() *timestamppb.Timestamp
func (*GitUnstageOp) MarshalJSON ¶
func (x *GitUnstageOp) MarshalJSON() ([]byte, error)
MarshalJSON marshals the GitUnstageOp to JSON.
func (*GitUnstageOp) MarshalProtoJSON ¶
func (x *GitUnstageOp) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the GitUnstageOp message to JSON.
func (*GitUnstageOp) MarshalProtoText ¶
func (x *GitUnstageOp) MarshalProtoText() string
func (*GitUnstageOp) MarshalToSizedBufferVT ¶
func (m *GitUnstageOp) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*GitUnstageOp) MarshalToVT ¶
func (m *GitUnstageOp) MarshalToVT(dAtA []byte) (int, error)
func (*GitUnstageOp) MarshalVT ¶
func (m *GitUnstageOp) MarshalVT() (dAtA []byte, err error)
func (*GitUnstageOp) ProtoMessage ¶
func (*GitUnstageOp) ProtoMessage()
func (*GitUnstageOp) Reset ¶
func (x *GitUnstageOp) Reset()
func (*GitUnstageOp) SizeVT ¶
func (m *GitUnstageOp) SizeVT() (n int)
func (*GitUnstageOp) String ¶
func (x *GitUnstageOp) String() string
func (*GitUnstageOp) TypeID ¶
func (*GitUnstageOp) TypeID() string
TypeID returns the type ID of GitUnstageOp.
func (*GitUnstageOp) UnmarshalJSON ¶
func (x *GitUnstageOp) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the GitUnstageOp from JSON.
func (*GitUnstageOp) UnmarshalProtoJSON ¶
func (x *GitUnstageOp) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the GitUnstageOp message from JSON.
func (*GitUnstageOp) UnmarshalVT ¶
func (m *GitUnstageOp) UnmarshalVT(dAtA []byte) error
func (*GitUnstageOp) Validate ¶
func (o *GitUnstageOp) Validate() error
Validate checks the unstage operation.
type GitWorktreeCheckoutOp ¶
type GitWorktreeCheckoutOp struct {
// ObjectKey is the object key of the Worktree.
ObjectKey string `protobuf:"bytes,1,opt,name=object_key,json=objectKey,proto3" json:"objectKey,omitempty"`
// RepoObjectKey is the key of the repository object.
RepoObjectKey string `protobuf:"bytes,2,opt,name=repo_object_key,json=repoObjectKey,proto3" json:"repoObjectKey,omitempty"`
// CheckoutOpts are options to use when checking out the data.
CheckoutOpts *block.CheckoutOpts `protobuf:"bytes,3,opt,name=checkout_opts,json=checkoutOpts,proto3" json:"checkoutOpts,omitempty"`
// Timestamp is the modification time for the workdir ops.
Timestamp *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
// contains filtered or unexported fields
}
GitWorktreeCheckoutOp checks out a git revision in a worktree. Note: cannot be run as a Object-specific op.
func NewGitWorktreeCheckoutOp ¶
func NewGitWorktreeCheckoutOp( objKey string, repoObjKey string, checkoutOpts *git_block.CheckoutOpts, ) *GitWorktreeCheckoutOp
NewGitWorktreeCheckoutOp constructs a new GitWorktreeCheckoutOp block. workdirObjKey, workdirPath, and ref can be empty.
func (*GitWorktreeCheckoutOp) ApplyWorldOp ¶
func (o *GitWorktreeCheckoutOp) ApplyWorldOp( ctx context.Context, le *logrus.Entry, worldHandle world.WorldState, sender peer.ID, ) (sysErr bool, err error)
ApplyWorldOp applies the operation as a world operation.
func (*GitWorktreeCheckoutOp) CloneMessageVT ¶
func (m *GitWorktreeCheckoutOp) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*GitWorktreeCheckoutOp) CloneVT ¶
func (m *GitWorktreeCheckoutOp) CloneVT() *GitWorktreeCheckoutOp
func (*GitWorktreeCheckoutOp) EqualMessageVT ¶
func (this *GitWorktreeCheckoutOp) EqualMessageVT(thatMsg any) bool
func (*GitWorktreeCheckoutOp) EqualVT ¶
func (this *GitWorktreeCheckoutOp) EqualVT(that *GitWorktreeCheckoutOp) bool
func (*GitWorktreeCheckoutOp) GetCheckoutOpts ¶
func (x *GitWorktreeCheckoutOp) GetCheckoutOpts() *block.CheckoutOpts
func (*GitWorktreeCheckoutOp) GetObjectKey ¶
func (x *GitWorktreeCheckoutOp) GetObjectKey() string
func (*GitWorktreeCheckoutOp) GetRepoObjectKey ¶
func (x *GitWorktreeCheckoutOp) GetRepoObjectKey() string
func (*GitWorktreeCheckoutOp) GetTimestamp ¶
func (x *GitWorktreeCheckoutOp) GetTimestamp() *timestamppb.Timestamp
func (*GitWorktreeCheckoutOp) MarshalJSON ¶
func (x *GitWorktreeCheckoutOp) MarshalJSON() ([]byte, error)
MarshalJSON marshals the GitWorktreeCheckoutOp to JSON.
func (*GitWorktreeCheckoutOp) MarshalProtoJSON ¶
func (x *GitWorktreeCheckoutOp) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the GitWorktreeCheckoutOp message to JSON.
func (*GitWorktreeCheckoutOp) MarshalProtoText ¶
func (x *GitWorktreeCheckoutOp) MarshalProtoText() string
func (*GitWorktreeCheckoutOp) MarshalToSizedBufferVT ¶
func (m *GitWorktreeCheckoutOp) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*GitWorktreeCheckoutOp) MarshalToVT ¶
func (m *GitWorktreeCheckoutOp) MarshalToVT(dAtA []byte) (int, error)
func (*GitWorktreeCheckoutOp) MarshalVT ¶
func (m *GitWorktreeCheckoutOp) MarshalVT() (dAtA []byte, err error)
func (*GitWorktreeCheckoutOp) ProtoMessage ¶
func (*GitWorktreeCheckoutOp) ProtoMessage()
func (*GitWorktreeCheckoutOp) Reset ¶
func (x *GitWorktreeCheckoutOp) Reset()
func (*GitWorktreeCheckoutOp) SizeVT ¶
func (m *GitWorktreeCheckoutOp) SizeVT() (n int)
func (*GitWorktreeCheckoutOp) String ¶
func (x *GitWorktreeCheckoutOp) String() string
func (*GitWorktreeCheckoutOp) TypeID ¶
func (*GitWorktreeCheckoutOp) TypeID() string
TypeID returns the type ID of GitWorktreeCheckoutOp.
func (*GitWorktreeCheckoutOp) UnmarshalJSON ¶
func (x *GitWorktreeCheckoutOp) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the GitWorktreeCheckoutOp from JSON.
func (*GitWorktreeCheckoutOp) UnmarshalProtoJSON ¶
func (x *GitWorktreeCheckoutOp) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the GitWorktreeCheckoutOp message from JSON.
func (*GitWorktreeCheckoutOp) UnmarshalVT ¶
func (m *GitWorktreeCheckoutOp) UnmarshalVT(dAtA []byte) error
func (*GitWorktreeCheckoutOp) Validate ¶
func (o *GitWorktreeCheckoutOp) Validate() error
Validate checks the create worktree operation.
type HeadRefStore ¶
type HeadRefStore struct {
// SubmoduleName is the name of the submodule if this is a submodule.
SubmoduleName string `protobuf:"bytes,1,opt,name=submodule_name,json=submoduleName,proto3" json:"submoduleName,omitempty"`
// HeadRef is the reference to the HEAD checked out in the worktree.
// If unset, uses the store HEAD ref.
HeadRef *block.Reference `protobuf:"bytes,2,opt,name=head_ref,json=headRef,proto3" json:"headRef,omitempty"`
// Submodules contains the references for the submodules.
// sorted by name
Submodules []*HeadRefStore `protobuf:"bytes,3,rep,name=submodules,proto3" json:"submodules,omitempty"`
// contains filtered or unexported fields
}
HeadRefStore contains the HEAD reference for a worktree and submodules.
func (*HeadRefStore) BlockAliasIdentity ¶ added in v0.52.0
func (h *HeadRefStore) BlockAliasIdentity() *block.AliasIdentityToken
BlockAliasIdentity returns the in-memory alias token for HeadRefStore.
func (*HeadRefStore) ClearSubmoduleStore ¶
func (h *HeadRefStore) ClearSubmoduleStore(bcs *block.Cursor, name string) error
ClearSubmoduleStore is called if a submodule is deleted.
should not return an error if not found.
func (*HeadRefStore) CloneMessageVT ¶
func (m *HeadRefStore) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*HeadRefStore) CloneVT ¶
func (m *HeadRefStore) CloneVT() *HeadRefStore
func (*HeadRefStore) EqualMessageVT ¶
func (this *HeadRefStore) EqualMessageVT(thatMsg any) bool
func (*HeadRefStore) EqualVT ¶
func (this *HeadRefStore) EqualVT(that *HeadRefStore) bool
func (*HeadRefStore) GetHeadRef ¶
func (x *HeadRefStore) GetHeadRef() *block.Reference
func (*HeadRefStore) GetName ¶
func (h *HeadRefStore) GetName() string
GetName returns the name of the ref.
func (*HeadRefStore) GetReference ¶
func (h *HeadRefStore) GetReference(ref plumbing.ReferenceName) (*plumbing.Reference, error)
GetReference returns the reference by name.
if nil, nil is returned, uses default store logic.
func (*HeadRefStore) GetSubmoduleName ¶
func (x *HeadRefStore) GetSubmoduleName() string
func (*HeadRefStore) GetSubmoduleStore ¶
func (h *HeadRefStore) GetSubmoduleStore(bcs *block.Cursor, name string) (*HeadRefStore, *block.Cursor, error)
GetSubmoduleStore returns the refs store for a submodule.
func (*HeadRefStore) GetSubmodules ¶
func (x *HeadRefStore) GetSubmodules() []*HeadRefStore
func (*HeadRefStore) IsNil ¶
func (h *HeadRefStore) IsNil() bool
IsNil returns if the object is nil.
func (*HeadRefStore) MarshalJSON ¶
func (x *HeadRefStore) MarshalJSON() ([]byte, error)
MarshalJSON marshals the HeadRefStore to JSON.
func (*HeadRefStore) MarshalProtoJSON ¶
func (x *HeadRefStore) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the HeadRefStore message to JSON.
func (*HeadRefStore) MarshalProtoText ¶
func (x *HeadRefStore) MarshalProtoText() string
func (*HeadRefStore) MarshalToSizedBufferVT ¶
func (m *HeadRefStore) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*HeadRefStore) MarshalToVT ¶
func (m *HeadRefStore) MarshalToVT(dAtA []byte) (int, error)
func (*HeadRefStore) MarshalVT ¶
func (m *HeadRefStore) MarshalVT() (dAtA []byte, err error)
func (*HeadRefStore) ProtoMessage ¶
func (*HeadRefStore) ProtoMessage()
func (*HeadRefStore) Reset ¶
func (x *HeadRefStore) Reset()
func (*HeadRefStore) SetReference ¶
func (h *HeadRefStore) SetReference(bcs *block.Cursor, ref *plumbing.Reference) (set bool, err error)
SetReference sets the HEAD reference.
ignores any non-HEAD reference returns set, error. if !set, will use default store logic.
func (*HeadRefStore) SizeVT ¶
func (m *HeadRefStore) SizeVT() (n int)
func (*HeadRefStore) String ¶
func (x *HeadRefStore) String() string
func (*HeadRefStore) UnmarshalJSON ¶
func (x *HeadRefStore) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the HeadRefStore from JSON.
func (*HeadRefStore) UnmarshalProtoJSON ¶
func (x *HeadRefStore) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the HeadRefStore message from JSON.
func (*HeadRefStore) UnmarshalVT ¶
func (m *HeadRefStore) UnmarshalVT(dAtA []byte) error
func (*HeadRefStore) Validate ¶
func (h *HeadRefStore) Validate() error
Validate validates the head ref store.
type HeadRefStoreCursor ¶
type HeadRefStoreCursor struct {
// contains filtered or unexported fields
}
HeadRefStoreCursor implements ReferencesStore with a HeadRefStore.
func NewHeadRefStoreCursor ¶
func NewHeadRefStoreCursor(bcs *block.Cursor, hrs *HeadRefStore) *HeadRefStoreCursor
NewHeadRefStoreCursor builds an new worktree-backed ReferencesStore. Stores HEAD only.
func (*HeadRefStoreCursor) ClearSubmoduleStore ¶
func (r *HeadRefStoreCursor) ClearSubmoduleStore(name string) error
ClearSubmoduleStore is called if a submodule is deleted.
should not return an error if not found.
func (*HeadRefStoreCursor) GetReference ¶
func (r *HeadRefStoreCursor) GetReference(ref plumbing.ReferenceName) (*plumbing.Reference, error)
GetReference returns the reference by name.
if nil, nil is returned, uses default store logic.
func (*HeadRefStoreCursor) GetSubmoduleStore ¶
func (r *HeadRefStoreCursor) GetSubmoduleStore(name string) (git_block.ReferenceStore, error)
GetSubmoduleStore returns the refs store for a submodule.
Can return nil, nil to indicate none.
func (*HeadRefStoreCursor) SetReference ¶
func (r *HeadRefStoreCursor) SetReference(ref *plumbing.Reference) (set bool, err error)
SetReference sets the HEAD reference.
ignores any non-HEAD reference returns set, error. if !set, will use default store logic.
type Worktree ¶
type Worktree struct {
// GitIndex is the git index for the worktree.
GitIndex *block.Index `protobuf:"bytes,1,opt,name=git_index,json=gitIndex,proto3" json:"gitIndex,omitempty"`
// HeadRefStore contains the HEAD reference for a worktree and submodules.
HeadRefStore *HeadRefStore `protobuf:"bytes,2,opt,name=head_ref_store,json=headRefStore,proto3" json:"headRefStore,omitempty"`
// contains filtered or unexported fields
}
Worktree refers to a location where a repo is checked out. Contains an index and an attached working directory.
func UnmarshalWorktree ¶
UnmarshalWorktree unmarshals a repo from a cursor. If empty, returns nil, nil
func (*Worktree) ApplySubBlock ¶
ApplySubBlock applies a sub-block change with a field id.
func (*Worktree) CloneMessageVT ¶
func (m *Worktree) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*Worktree) EqualMessageVT ¶
func (*Worktree) FollowHeadRefStore ¶
func (r *Worktree) FollowHeadRefStore(bcs *block.Cursor) (*HeadRefStoreCursor, error)
FollowHeadRefStore follows the head ref store sub-block.
func (*Worktree) GetGitIndex ¶
func (*Worktree) GetHeadRefStore ¶
func (x *Worktree) GetHeadRefStore() *HeadRefStore
func (*Worktree) GetSubBlockCtor ¶
func (r *Worktree) GetSubBlockCtor(id uint32) block.SubBlockCtor
GetSubBlockCtor returns a function which creates or returns the existing sub-block at reference id. Can return nil to indicate invalid reference id.
func (*Worktree) GetSubBlocks ¶
GetSubBlocks returns all constructed sub-blocks by ID. May return nil, and values may also be nil.
func (*Worktree) MarshalJSON ¶
MarshalJSON marshals the Worktree to JSON.
func (*Worktree) MarshalProtoJSON ¶
func (x *Worktree) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the Worktree message to JSON.
func (*Worktree) MarshalProtoText ¶
func (*Worktree) MarshalToSizedBufferVT ¶
func (*Worktree) ProtoMessage ¶
func (*Worktree) ProtoMessage()
func (*Worktree) UnmarshalJSON ¶
UnmarshalJSON unmarshals the Worktree from JSON.
func (*Worktree) UnmarshalProtoJSON ¶
func (x *Worktree) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the Worktree message from JSON.