{"record":{"id":"fc42b97241b6b190","repo":"GitoxideLabs/gitoxide","slug":"the-rebase-state-repeats-its-resolved-conflict","errorCode":null,"errorMessage":"the rebase state repeats its resolved conflict","messagePattern":"the rebase state repeats its resolved conflict","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gix-tix/src/edit/todo.rs","lineNumber":750,"sourceCode":"                    .map_err(gix::Exn::into_error)\n                    .context(\"could not unquote a captured ref name\")?;\n                if !encoded_name[consumed..].trim().is_empty() {\n                    anyhow::bail!(\"a captured ref name has trailing data\");\n                }\n                let name = gix::refs::FullName::try_from(name.as_ref()).context(\"a captured ref name is invalid\")?;\n                expected_refs.push(rebase::ExpectedRef {\n                    name,\n                    old,\n                    target,\n                    new: old,\n                    follows_tip,\n                    editable,\n                    placement: None,\n                });\n            }\n            \"resolved\" => {\n                if resolved.replace(ObjectId::from_hex(value.as_bytes())?).is_some() {\n                    anyhow::bail!(\"the rebase state repeats its resolved conflict\");\n                }\n            }\n            \"continuation-source\" => continuation_sources.push(ObjectId::from_hex(value.as_bytes())?),\n            _ => anyhow::bail!(\"unsupported rebase state field {key:?}\"),\n        }\n    }\n    let state = State {\n        base: base.context(\"the rebase state has no base\")?,\n        onto: onto.context(\"the rebase state has no onto target\")?,\n        tips,\n        scope,\n        marker_required: marker_required.context(\"the rebase state has no marker requirement\")?,\n        checkout_allowed: checkout_allowed.context(\"the rebase state has no checkout capability\")?,\n        head_ref,\n        edit_refs,\n        expected_refs,\n        resolved,\n        continuation_sources,","sourceCodeStart":732,"sourceCodeEnd":768,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-tix/src/edit/todo.rs#L732-L768","documentation":"The `resolved` field records the OID of a resolved conflict and is single-valued. `parse_state` uses `resolved.replace(...)` and bails when it already held a value, i.e. the state file contains a second `resolved` line. This enforces the one-occurrence rule for scalar state fields.","triggerScenarios":"`parse_state` (gix-tix/src/edit/todo.rs:750) reading a state file with two `resolved <oid>` lines — from hand edits, corrupted state, or appending automation.","commonSituations":"Users manually editing conflict-resolution state; scripts appending instead of replacing the OID after a new resolution; state files merged from divergent worktrees.","solutions":["Keep exactly one `resolved <oid>` line, pointing at the most recent resolution.","Delete the `resolved` line if no resolution should be recorded, then continue the operation.","Restart the operation to regenerate consistent state."],"exampleFix":"// before (state file)\nresolved 0123abc...\nresolved 4567def...\n// after\nresolved 4567def...","handlingStrategy":"validation","validationCode":"fn state_file_is_clean(text: &str) -> bool {\n    text.lines().filter(|l| l.starts_with(\"resolved \")).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 its resolved conflict\") => {\n        eprintln!(\"corrupt state: duplicate resolved; keep the latest OID only\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["When recording a new resolution, rewrite the resolved line rather than appending.","Validate state files after programmatic modification.","Abort cleanly instead of killing the process mid-write to avoid corruption."],"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"}