fix(#727): add has_upstream bool to branch_freshness JSON to disambiguate fresh:null-no-upstream from fresh:null-unknown

This commit is contained in:
YeonGyu-Kim
2026-05-26 10:34:28 +09:00
parent a0c6c8ba53
commit 9757fef8a7
2 changed files with 6 additions and 0 deletions

View File

@@ -3326,6 +3326,10 @@ impl BranchFreshness {
fn json_value(&self) -> serde_json::Value {
json!({
"upstream": self.upstream,
// #727: has_upstream disambiguates fresh:null-because-no-upstream
// from fresh:null-because-unavailable; automation should check
// has_upstream before branching on fresh.
"has_upstream": self.upstream.is_some(),
"ahead": self.ahead,
"behind": self.behind,
"fresh": self.fresh,