Documentation
¶
Overview ¶
Package sandbox runs repository checks against an isolated Git index and checkout. It never writes the source index, creates branches, registers worktrees, or fetches refs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidOptions indicates an unsupported sandbox scope or option. ErrInvalidOptions = errors.New("invalid Git sandbox options") // ErrClosed indicates a sandbox that has already finished or been removed. ErrClosed = errors.New("git sandbox is closed or finished") // ErrUnsafePath indicates a path outside the checkout or inside Git metadata. ErrUnsafePath = errors.New("unsafe repository path") // ErrUnmergedIndex prevents checking an index containing unresolved conflicts. ErrUnmergedIndex = errors.New("resolve unmerged index entries before running repository checks") // ErrFixConflict means a fix could not be safely applied to the working file. ErrFixConflict = errors.New("formatter fix conflict") // ErrSupportFile indicates an invalid support-file copy. ErrSupportFile = errors.New("invalid sandbox support file") // ErrFileType indicates a file state that cannot be captured or written. ErrFileType = errors.New("unsupported file type") // ErrMissingBase identifies an unavailable comparison ref. ErrMissingBase = errors.New("comparison base unavailable") )
Functions ¶
func CleanEnvironment ¶
CleanEnvironment removes the caller's repository/index overrides before invoking Git in a different checkout. Source reads must retain these overrides, especially GIT_INDEX_FILE supplied by git commit --only.
Types ¶
type Options ¶
type Options struct {
Directory string
Scope string
BaseRef string
Env []string
Runner atmosgit.Runner
Stderr io.Writer
OnProgress func(Progress)
}
Options controls selection and the checkout contents. Staged uses the caller's index; pr and all overlay tracked working-tree contents. No refs are fetched.
type Sandbox ¶
type Sandbox struct {
Root string
Path string
Scope string
Base string
Files []string
Added []string
// contains filtered or unexported fields
}
Sandbox owns a temporary repository. Call Close even if checks or reconciliation fail. Files and Added contain repo-relative paths; Base is a resolved commit.
func (*Sandbox) Copy ¶
Copy adds an existing, untracked support file such as a prebuilt linter. Its timestamp and permissions are preserved. It is never reconciled into the source.