{"record":{"id":"c5a5a2aebdadbcf7","repo":"GitoxideLabs/gitoxide","slug":"a-non-delta-entry","errorCode":null,"errorMessage":"a non-delta entry","messagePattern":"a non-delta entry","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"gix-pack/src/data/file/decode/entry.rs","lineNumber":207,"sourceCode":"        &self,\n        entry: data::Entry,\n        out: &mut Vec<u8>,\n        inflate: &mut gix_zlib::Inflate,\n        resolve: &dyn Fn(&gix_hash::oid, &mut Vec<u8>) -> Option<ResolvedBase>,\n        delta_cache: &mut dyn cache::DecodeEntry,\n    ) -> Result<Outcome, Error> {\n        use crate::data::entry::Header::*;\n        match entry.header {\n            Tree | Blob | Commit | Tag => {\n                let size = self.decoded_object_size(entry.decompressed_size)?;\n                if let Some(additional) = size.checked_sub(out.len()) {\n                    out.try_reserve(additional)?;\n                }\n                out.resize(size, 0);\n                self.decompress_entry(&entry, inflate, out.as_mut_slice())\n                    .map(|consumed_input| {\n                        Outcome::from_object_entry(\n                            entry.header.as_kind().expect(\"a non-delta entry\"),\n                            &entry,\n                            consumed_input,\n                        )\n                    })\n            }\n            OfsDelta { .. } | RefDelta { .. } => self.resolve_deltas(entry, resolve, inflate, out, delta_cache),\n        }\n    }\n\n    /// resolve: technically, this shouldn't ever be required as stored local packs don't refer to objects by id\n    /// that are outside of the pack. Unless, of course, the ref refers to an object within this pack, which means\n    /// it's very, very large as 20bytes are smaller than the corresponding MSB encoded number\n    fn resolve_deltas(\n        &self,\n        last: data::Entry,\n        resolve: &dyn Fn(&gix_hash::oid, &mut Vec<u8>) -> Option<ResolvedBase>,\n        inflate: &mut gix_zlib::Inflate,\n        out: &mut Vec<u8>,","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-pack/src/data/file/decode/entry.rs#L189-L225","documentation":"This is a Rust `expect()` panic, not a recoverable error. `decode_entry` decompresses a pack entry that was matched as a non-delta kind (Tree/Blob/Commit/Tag) and then calls `entry.header.as_kind()`, which returns `None` only for delta headers. By construction this branch can only hold a non-delta header, so the expect encodes an internal invariant; failure means a logic bug in gix-pack.","triggerScenarios":"Calling `gix_pack::data::File::decode_entry` on a non-delta entry; the panic fires only if the match arm guarding this code ever admits an `OfsDelta`/`RefDelta` header, i.e. due to a library bug or modified/internal code paths.","commonSituations":"Practically never hit by library users; seen during gix-pack development, when patching the decoder, or when fuzzing mutated pack files through decode_entry.","solutions":["Update gix-pack to the latest patch release in case the invariant was fixed","Do not construct or decode pack entries with hand-modified headers; use intact packs","If reproducible, file a bug with the pack file and the call stack"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"let outcome = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| pack.decode_entry(id, &mut out, ...)));\nmatch outcome {\n    Ok(res) => res, // Result already conveys decode errors\n    Err(_) => eprintln!(\"gix-pack internal panic while decoding entry\"),\n}","preventionTips":["Keep gix-pack updated to released versions","Do not decode hand-crafted or mutated pack entries","If you see this panic, treat it as a bug and report it"],"tags":["rust","panic","internal-invariant","gix-pack","pack-decoding"],"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"}