{"record":{"id":"d3fed122471645c6","repo":"GitoxideLabs/gitoxide","slug":"the-rebase-state-repeats-checkout-allowed","errorCode":null,"errorMessage":"the rebase state repeats checkout-allowed","messagePattern":"the rebase state repeats checkout-allowed","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gix-tix/src/edit/todo.rs","lineNumber":702,"sourceCode":"                if base.replace(ObjectId::from_hex(value.as_bytes())?).is_some() {\n                    anyhow::bail!(\"the rebase state has more than one base\");\n                }\n            }\n            \"onto\" => {\n                if onto.replace(ObjectId::from_hex(value.as_bytes())?).is_some() {\n                    anyhow::bail!(\"the rebase state has more than one onto target\");\n                }\n            }\n            \"tip\" => tips.push(ObjectId::from_hex(value.as_bytes())?),\n            \"scope\" => scope.push(ObjectId::from_hex(value.as_bytes())?),\n            \"marker-required\" => {\n                if marker_required.replace(value.parse()?).is_some() {\n                    anyhow::bail!(\"the rebase state repeats marker-required\");\n                }\n            }\n            \"checkout-allowed\" => {\n                if checkout_allowed.replace(value.parse()?).is_some() {\n                    anyhow::bail!(\"the rebase state repeats checkout-allowed\");\n                }\n            }\n            \"head-ref\" => {\n                let encoded = value.as_bytes().as_bstr();\n                let (name, consumed) = gix::quote::ansi_c::undo(encoded)\n                    .map_err(gix::Exn::into_error)\n                    .context(\"could not unquote the recorded HEAD ref\")?;\n                if !encoded[consumed..].trim().is_empty() {\n                    anyhow::bail!(\"the recorded HEAD ref has trailing data\");\n                }\n                let name = gix::refs::FullName::try_from(name.as_ref()).context(\"the recorded HEAD ref is invalid\")?;\n                if head_ref.replace(name).is_some() {\n                    anyhow::bail!(\"the rebase state repeats its HEAD ref\");\n                }\n            }\n            \"edit-refs\" => edit_refs = value.parse()?,\n            \"ref\" => {\n                let (old, value) = value.split_once(' ').context(\"a captured ref has no target\")?;","sourceCodeStart":684,"sourceCodeEnd":720,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-tix/src/edit/todo.rs#L684-L720","documentation":"Same duplicate-field protection as `marker-required`, but for the `checkout-allowed` key: `parse_state` encountered a second `checkout-allowed <bool>` line in the rebase state file. Each scalar field may appear only once; a repeat indicates a malformed state file and is rejected instead of silently overwriting the first value.","triggerScenarios":"`parse_state` (gix-tix/src/edit/todo.rs:702) reading a state file containing more than one `checkout-allowed` line; hand-edited, corrupted, or concurrently-written rebase state.","commonSituations":"Manual editing mistakes in a rebase state file; automation appending fields instead of replacing them; state files shared between two worktrees or interrupted tool runs.","solutions":["Deduplicate the `checkout-allowed` lines in the state file, keeping one.","Regenerate the state by restarting the rebase/edit operation from scratch.","Verify no concurrent process is writing to the state file while it is being parsed."],"exampleFix":"// before (state file)\ncheckout-allowed true\ncheckout-allowed false\n// after\ncheckout-allowed true","handlingStrategy":"validation","validationCode":"fn state_file_is_clean(text: &str) -> bool {\n    text.lines().filter(|l| l.starts_with(\"checkout-allowed \")).count() <= 1\n}","typeGuard":null,"tryCatchPattern":"match todo::parse(state_text) {\n    Ok(state) => apply(state),\n    Err(e) if e.to_string().contains(\"repeats checkout-allowed\") => {\n        eprintln!(\"corrupt state: duplicate checkout-allowed; regenerate state\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Write scalar fields with replace-not-append semantics in any state-mutating script.","Validate the state file after every write with a duplicate-line check.","Avoid sharing state files between worktrees."],"tags":["rebase","state-parsing","duplicate-field","git"],"backgroundTag":"schema-validation-failed","analyzedSha":"e73179060badf27222d790981fac3f84c1830a7e","analyzedAt":"2026-09-08T11:26:50.865Z","contentChangedAt":"2026-09-08T11:26:50.865Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}