Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Layer ¶
type Layer struct {
Branch string
PR *github.PullRequest
Parent string
}
func Walk ¶
func Walk(currentBranch, trunk string, prs []github.PullRequest, localBranches map[string]bool) ([]Layer, error)
Walk returns the chain of branches from the bottom of the stack (closest to trunk) up to and including currentBranch. The first element's Parent is empty — meaning its base is the trunk.
v0.1 walks the GitHub PR graph: every branch in the chain must have a PR for it to appear in the result. If currentBranch has no PR, or any intermediate parent has no PR before reaching trunk, the function returns an empty slice (not an error) — callers should treat that as "not currently in a stack".
localBranches is reserved for v0.2 richer-validation use (e.g. rejecting chains rooted on a foreign user's branch) and is unused by the v0.1 algorithm.