Documentation
¶
Overview ¶
Package sync performs weft's git synchronization: commit local changes, rebase-pull, then push. It is weft's second deliberate disk-mutating surface (alongside internal/edit) and shells out to the system `git`.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result struct {
Committed bool // a commit was created (working tree had changes)
Pulled bool // pull --rebase advanced the working tree
Pushed bool // push succeeded
Stage string // failing stage; "" on success
Output string // combined output of the failing stage; "" on success
Err error // non-nil on failure
}
Result reports what a sync did and, on failure, where it stopped.
type WorktreeStatus ¶
type WorktreeStatus struct {
Dirty bool // working tree has uncommitted changes
Ahead int // commits on HEAD not yet on the upstream branch (0 if no upstream)
}
WorktreeStatus is a read-only snapshot of where the graph repo stands relative to its last commit and its upstream. It is the read sibling of Run.
func Status ¶
func Status(repoDir string) (WorktreeStatus, error)
Status probes repoDir's git state without mutating anything. It returns an error only when repoDir is not inside a git work tree; callers treat that as "no indicator" rather than a failure. A missing upstream is not an error — Ahead is simply left 0, since there's nothing local to measure against.
func (WorktreeStatus) Unsynced ¶
func (s WorktreeStatus) Unsynced() bool
Unsynced reports whether there is local work not yet pushed: either uncommitted changes or committed-but-unpushed commits.