pub struct DetectContext<'a> {
pub current_branch: &'a str,
pub home_branch: &'a str,
pub working_dir: &'a WorkingDirState,
pub sync_state: &'a SyncState,
pub pr_info: Option<&'a PrInfo>,
pub has_remote: bool,
pub base_pr_merged: Option<&'a str>,
pub recorded_base: Option<&'a str>,
pub recorded_base_merged: bool,
pub recorded_base_sha: Option<&'a str>,
pub base_ref: &'a str,
pub behind_base: usize,
}Expand description
Inputs for NextAction::detect. Bundled into a struct because the detected
state depends on many independent signals; named fields keep call sites
legible and let new signals be added without churning every caller.
Fields§
§current_branch: &'a str§home_branch: &'a str§working_dir: &'a WorkingDirState§sync_state: &'a SyncState§pr_info: Option<&'a PrInfo>§has_remote: bool§base_pr_merged: Option<&'a str>This branch’s PR’s base was merged (post-PR restack trigger).
recorded_base: Option<&'a str>Locally recorded stacked base (gw new --stack), filtered to a real
parent. Drives the -B <base> create-PR suggestion before a PR exists.
recorded_base_merged: boolThe recorded base’s PR has already merged (stale stacked base): the branch should rebase onto the default branch and open a normal PR.
recorded_base_sha: Option<&'a str>Recorded base tip SHA (gw new --stack); the --onto boundary that
survives the base branch being deleted.
base_ref: &'a strThe ref this branch should sit on: the stacked parent while one is in
flight, else the default branch (origin/main). Display only.
behind_base: usizeCommits on base_ref that this branch does not have.