Documentation
¶
Overview ¶
Package index manages .agentstore/index.db — the local working state that is never pushed to the server: staged changes, merge-in-progress marker.
Index ¶
- type Index
- func (i *Index) Clear() error
- func (i *Index) ClearMergeState() error
- func (i *Index) ClearUnresolved(path string) error
- func (i *Index) Close() error
- func (i *Index) Entries() ([]StagedEntry, error)
- func (i *Index) Get(path string) (*StagedEntry, error)
- func (i *Index) GetMergeState() (*MergeState, error)
- func (i *Index) SetMergeState(ms MergeState) error
- func (i *Index) SetUnresolved(path string) error
- func (i *Index) Stage(e StagedEntry) error
- func (i *Index) UnresolvedPaths() ([]string, error)
- func (i *Index) Unstage(path string) error
- type MergeState
- type StagedEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index is a handle to index.db.
func Init ¶
Init creates (or opens) index.db in storeDir with the schema applied. Safe to call on an already-initialized index.
func (*Index) ClearMergeState ¶
ClearMergeState removes the merge-in-progress marker.
func (*Index) ClearUnresolved ¶
ClearUnresolved marks path as resolved.
func (*Index) Entries ¶
func (i *Index) Entries() ([]StagedEntry, error)
Entries returns all staged entries.
func (*Index) Get ¶
func (i *Index) Get(path string) (*StagedEntry, error)
Get returns the staged entry for path, or nil if not staged.
func (*Index) GetMergeState ¶
func (i *Index) GetMergeState() (*MergeState, error)
GetMergeState returns the current merge state, or nil if no merge is in progress.
func (*Index) SetMergeState ¶
func (i *Index) SetMergeState(ms MergeState) error
SetMergeState records an in-progress merge. Replaces any prior state.
func (*Index) SetUnresolved ¶
SetUnresolved marks path as having unresolved conflict markers.
func (*Index) Stage ¶
func (i *Index) Stage(e StagedEntry) error
Stage upserts a staged entry. For a deletion, set ObjectHash = "".
func (*Index) UnresolvedPaths ¶
UnresolvedPaths returns all paths still marked as having conflict markers.
type MergeState ¶
type MergeState struct {
SecondParentCommitID string
}
MergeState records an in-progress merge after a conflicting pull.