{"record":{"id":"9554f27f9c02cb1a","repo":"GitoxideLabs/gitoxide","slug":"infallible-name-conversion","errorCode":null,"errorMessage":"infallible name conversion","messagePattern":"infallible name conversion","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gix-ref/src/store/file/raw_ext.rs","lineNumber":114,"sourceCode":"        &self,\n        store: &file::Store,\n        packed: Option<&packed::Buffer>,\n    ) -> Option<Result<Reference, file::find::existing::Error>>;\n}\n\nimpl ReferenceExt for Reference {\n    fn log_iter<'a, 's>(&'a self, store: &'s file::Store) -> log::iter::Platform<'a, 's> {\n        log::iter::Platform {\n            store,\n            name: self.name.as_ref(),\n            buf: Vec::new(),\n        }\n    }\n\n    fn log_exists(&self, store: &file::Store) -> bool {\n        store\n            .reflog_exists(self.name.as_ref())\n            .expect(\"infallible name conversion\")\n    }\n\n    fn peel_to_id_in_place(\n        &mut self,\n        store: &file::Store,\n        objects: &dyn gix_object::Find,\n    ) -> Result<ObjectId, peel::to_id::Error> {\n        self.peel_to_id(store, objects)\n    }\n\n    fn peel_to_id(\n        &mut self,\n        store: &file::Store,\n        objects: &dyn gix_object::Find,\n    ) -> Result<ObjectId, peel::to_id::Error> {\n        let packed = store.assure_packed_refs_uptodate().map_err(|err| {\n            peel::to_id::Error::FollowToObject(peel::to_object::Error::Follow(file::find::existing::Error::Find(\n                file::find::Error::PackedOpen(err),","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-ref/src/store/file/raw_ext.rs#L96-L132","documentation":"This is a panic (not a returned error) raised by `.expect(\"infallible name conversion\")` inside `log_exists` in gix-ref's file store. The code converts a partial reference name to a fully qualified one via `reflog_exists`, which the developers assert can never fail because the name has already been validated as a partial ref name earlier in the pipeline. A panic here therefore indicates an internal bug in gix-ref's name validation, not a user-correctable condition.","triggerScenarios":"Calling `Repository::reflog_exists()` (or any path that reaches `gix_ref::store::file::raw_ext::log_exists`) when the internally stored partial name fails to convert to a full reference name — which per the invariant should be impossible.","commonSituations":"Essentially never hit by correct usage. Could surface during a gix-ref/gix version upgrade if name-validation logic changed, or when operating on unusual ref names (e.g. unusual casing or encoding) that expose a validation gap.","solutions":["Report the panic as a bug to the gitoxide project with the ref name and stack trace.","Verify the ref name being queried is a well-formed partial ref name (no invalid characters, correct `refs/...` shape).","Pin or update the gix/gix-ref version to one where the name-conversion invariant holds."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// gix: validate the partial ref name before querying reflogs\nif gix_ref::name::partial::check_ref_name_valid(name.as_ref()).is_err() {\n    return Err(\"invalid ref name\".into());\n}\nlet exists = repo.reflog_exists(name)?;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate ref names with gix's own name checks before any ref/reflog API call.","Treat panics inside gix-ref as bugs and capture the ref name in bug reports.","Pin gix versions and read changelogs for name-validation changes."],"tags":["panic","internal-invariant","reflog","rust"],"backgroundTag":"internal-invariant-violation","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"}