{"record":{"id":"ea8ee954e6f7351e","repo":"zed-industries/zed","slug":"invalid-unmerged-status-code-byte","errorCode":null,"errorMessage":"Invalid unmerged status code: {byte}","messagePattern":"Invalid unmerged status code: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/git/src/status.rs","lineNumber":280,"sourceCode":"            worktree_status: StatusCode::Unmodified,\n        })\n    }\n\n    pub fn worktree(self) -> FileStatus {\n        FileStatus::Tracked(TrackedStatus {\n            index_status: StatusCode::Unmodified,\n            worktree_status: self,\n        })\n    }\n}\n\nimpl UnmergedStatusCode {\n    fn from_byte(byte: u8) -> anyhow::Result<Self> {\n        match byte {\n            b'A' => Ok(UnmergedStatusCode::Added),\n            b'D' => Ok(UnmergedStatusCode::Deleted),\n            b'U' => Ok(UnmergedStatusCode::Updated),\n            _ => anyhow::bail!(\"Invalid unmerged status code: {byte}\"),\n        }\n    }\n}\n\n#[derive(Clone, Debug, Default, Copy, PartialEq, Eq)]\npub struct TrackedSummary {\n    pub added: usize,\n    pub modified: usize,\n    pub deleted: usize,\n}\n\nimpl TrackedSummary {\n    pub const UNCHANGED: Self = Self {\n        added: 0,\n        modified: 0,\n        deleted: 0,\n    };\n","sourceCodeStart":262,"sourceCodeEnd":298,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/git/src/status.rs#L262-L298","documentation":"For unmerged (conflicted) entries, the Y code of the XY pair is parsed by UnmergedStatusCode::from_byte, which accepts only A, D and U. Valid conflict pairs (UU, AA, DD, AU, UA, DU, UD) are handled earlier; this error fires only when git emits an unmerged pair whose second byte is outside that set.","triggerScenarios":"Repository is mid-merge/rebase/cherry-pick (so unmerged entries exist) and the status output contains an unexpected second byte in an unmerged pair — from a wrapper rewriting status output, misaligned line parsing, or a nonstandard git build.","commonSituations":"Parsing status captured during conflicts with modified tooling; git wrappers in CI that reformat output; mismatches between the flags used to capture output and the parser's assumptions.","solutions":["Run the exact status command during a conflict and inspect the XY bytes of unmerged lines.","Eliminate any wrapper/alias/env that rewrites `git status` stdout.","Keep capture flags and parser in sync (`--porcelain=v1 -z`).","Report upstream if a stock git emits an unmerged Y code outside A/D/U."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match stdout.parse::<GitStatus>() {\n    Err(e) if e.to_string().contains(\"Invalid unmerged status code\") => {\n        // capture raw output during the conflict; verify no wrapper rewrote it\n    }\n    other => other?,\n}","preventionTips":["During merges/rebases, ensure nothing reformats `git status` stdout (aliases, pagers, CI wrappers).","Keep capture flags in sync with the parser (--porcelain=v1 -z).","Report genuinely new unmerged codes upstream with the raw line."],"tags":["git","status","conflict","porcelain","parsing"],"backgroundTag":"git-status-porcelain-parse-error","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}