{"record":{"id":"a6c3eb70dbace173","repo":"GitoxideLabs/gitoxide","slug":"the-shortened-reference-name-is-ambiguous","errorCode":null,"errorMessage":"the shortened reference name is ambiguous","messagePattern":"the shortened reference name is ambiguous","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"gix-tix/src/edit/todo.rs","lineNumber":1136,"sourceCode":"            anyhow::bail!(\"a reference name is empty\");\n        }\n        out.push((marked, name.into_owned()));\n    }\n    Ok(out)\n}\n\nfn resolve_ref_name(\n    repo: &gix::Repository,\n    refs: &mut Vec<rebase::ExpectedRef>,\n    input: &gix::bstr::BStr,\n) -> Result<gix::refs::FullName> {\n    let mut matches = refs\n        .iter()\n        .filter(|reference| reference.editable && ref_display_name(&reference.name, refs).as_bstr() == input)\n        .map(|reference| reference.name.clone());\n    if let Some(name) = matches.next() {\n        if matches.next().is_some() {\n            anyhow::bail!(\"the shortened reference name is ambiguous\");\n        }\n        return Ok(name);\n    }\n    let full = if input.starts_with(b\"refs/\") {\n        input.to_owned()\n    } else {\n        let mut full = BString::from(\"refs/heads/\");\n        full.extend_from_slice(input);\n        full\n    };\n    let name = gix::refs::FullName::try_from(full).context(\"the todo contains an invalid reference name\")?;\n    if name.as_bstr().starts_with(crate::history::PIN_PREFIX)\n        || name.as_bstr().starts_with(crate::history::STASH_PREFIX)\n        || name.as_bstr().starts_with(crate::history::REVIEW_PREFIX)\n        || super::undo::is_queue_ref(name.as_bstr())\n        || matches!(\n            name.category(),\n            Some(gix::refs::Category::Tag | gix::refs::Category::RemoteBranch)","sourceCodeStart":1118,"sourceCodeEnd":1154,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-tix/src/edit/todo.rs#L1118-L1154","documentation":"Ambiguity check inside `resolve_ref_name`, called from `edit::todo::parse` when converting a reference name written in a `(ref)` todo line into a full `refs/...` name. The input is matched against the currently editable references by display name; if more than one editable reference shares the same shortened display name, the intent is ambiguous and parsing bails. Triggered by todos that use a short ref name that maps to multiple branches/refs; fix by writing the fully qualified ref name in the todo line.","triggerScenarios":"Thrown at gix-tix/src/edit/todo.rs:1136 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide the unambiguous shortened reference name in the todo so it matches exactly one editable reference","List the repository's editable references and their display names, then disambiguate the name by using its full form (e.g. refs/heads/topic instead of topic)","If two editable references genuinely share a display name, rename or delete one of them so the todo can refer to a single reference"],"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"}