Documentation
¶
Overview ¶
Package workspace checks out pull requests into isolated git worktrees.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager keeps one blobless bare clone per repo under root/repos and adds a detached worktree per review under root/worktrees.
func (*Manager) Checkout ¶
func (m *Manager) Checkout(ctx context.Context, repo string, number int, baseRef, headSHA string) (Workspace, func(), error)
Checkout fetches PR number's head and baseRef into the repo's bare clone, adds a detached worktree at headSHA, and writes the diff and commit list into a separate context dir. cleanup removes both; it is always non-nil and idempotent.
type Workspace ¶
type Workspace struct {
Dir string // worktree at the PR head
ContextDir string // Ghost-written review materials; outside Dir so PR content can't touch it
DiffPath string // full diff against origin/<base>
CommitsPath string // commits in the PR
}
Workspace is one review's checkout.
Click to show internal directories.
Click to hide internal directories.