{"record":{"id":"46938a648abca008","repo":"GitoxideLabs/gitoxide","slug":"name-must-be-a-direct-reference","errorCode":null,"errorMessage":"{name} must be a direct reference","messagePattern":"(.+?) must be a direct reference","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"gix-tix/src/edit/undo.rs","lineNumber":821,"sourceCode":"    Ok(Some(Queue {\n        tip,\n        cursor,\n        sentinel,\n        entries,\n        cursor_index,\n    }))\n}\n\nfn read_queue_ref(repo: &gix::Repository, name: &str) -> Result<Option<ObjectId>> {\n    let Some(reference) = repo\n        .try_find_reference(name)\n        .with_context(|| format!(\"could not read {name}\"))?\n    else {\n        return Ok(None);\n    };\n    match reference.target() {\n        gix::refs::TargetRef::Object(id) => Ok(Some(id.to_owned())),\n        gix::refs::TargetRef::Symbolic(_) => bail!(\"{name} must be a direct reference\"),\n    }\n}\n\nstruct ParsedCommit {\n    parent: Option<ObjectId>,\n    title: String,\n    changes: Vec<RefChange>,\n}\n\nfn parse_commit(repo: &gix::Repository, id: ObjectId) -> Result<ParsedCommit> {\n    let commit = repo\n        .find_commit(id)\n        .with_context(|| format!(\"could not find undo queue commit {id}\"))?\n        .decode()\n        .context(\"could not decode an undo queue commit\")?\n        .into_owned()\n        .context(\"could not own an undo queue commit\")?;\n    ensure!(","sourceCodeStart":803,"sourceCodeEnd":839,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-tix/src/edit/undo.rs#L803-L839","documentation":"Type check in `edit::undo::read_queue_ref`, which reads one of the undo queue's refs (tip or cursor) and expects it to point directly at an object ID. If the ref is symbolic (points at another ref instead of a commit), the undo queue's invariants are broken — its positions are tracked as concrete object IDs — so the read bails naming the offending ref. Fired when queue refs were replaced or corrupted, e.g. by hand-editing or external git commands repointing them. Fix by resetting the queue refs to direct object targets or clearing the queue.","triggerScenarios":"Thrown at gix-tix/src/edit/undo.rs:821 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check what the reference currently points at with git for-each-ref or tix, and if it is symbolic, clear the symbolic target so it stores an object ID directly","Recreate the queue reference as a direct reference to the intended commit object","Avoid tools or manual edits that attach symbolic targets to the internal undo-queue references"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e73179060badf27222d790981fac3f84c1830a7e","analyzedAt":"2026-09-08T11:26:50.865Z","contentChangedAt":"2026-09-08T11:26:50.865Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}