{"record":{"id":"ff1e00b213c3dec5","repo":"jdx/mise","slug":"invalid-transferred-repository-bundle","errorCode":null,"errorMessage":"invalid transferred repository bundle","messagePattern":"invalid transferred repository bundle","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/remote_repository.rs","lineNumber":149,"sourceCode":"        .unwrap_or(*crate::dirs::CONFIG)\n        .to_path_buf()\n}\n\n/// The branch of a transferred bundle whose tree carries the setup\n/// repository marker (`.mise-history/format.toml`); `None` for an ordinary\n/// repository.\npub(crate) fn history_branch(bundle: &Path, revision: &str) -> Result<Option<String>> {\n    let temporary = tempfile::tempdir()?;\n    let checkout = temporary.path().join(\"checkout\");\n    let mut command = Command::new(\"git\");\n    crate::git::sanitize_git_command(&mut command);\n    let output = command\n        .args([\"clone\", \"--no-checkout\", \"--\"])\n        .arg(bundle)\n        .arg(&checkout)\n        .output()?;\n    if !output.status.success() {\n        bail!(\"invalid transferred repository bundle\");\n    }\n    let marker = format!(\"{revision}:.mise-history/format.toml\");\n    if git(&checkout, &[\"cat-file\", \"-e\", &marker]).is_err() {\n        return Ok(None);\n    }\n    Ok(Some(git(&checkout, &[\"symbolic-ref\", \"--short\", \"HEAD\"])?))\n}\n\n/// Installs the transferred revision as the global configuration checkout.\n/// A dry run runs every check and says what it would do (clone, fast-forward,\n/// adopt) without writing anything persistent.\npub(crate) fn install(\n    bundle: &Path,\n    origin: &str,\n    revision: &str,\n    update: bool,\n    yes: bool,\n    dry_run: bool,","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/remote_repository.rs#L131-L167","documentation":"history_branch clones the transferred repository bundle with `git clone --no-checkout` to inspect history. If the clone of the bundle fails, the bundle itself is invalid — corrupted, truncated, or not a git bundle.","triggerScenarios":"The bundle file produced during fetch is corrupt/missing (interrupted transfer, disk full) so `git clone --no-checkout -- <bundle>` exits nonzero.","commonSituations":"Partial download of the bundle over an unstable network, manual tampering, or a stale cached bundle from a failed previous run.","solutions":["Re-run the fetch to regenerate a fresh repository bundle","Verify the bundle with `git bundle verify <file>`","Clear any cached/stale bundle files and retry"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// preflight: verify bundle integrity before use\n// $ git bundle verify repository.bundle","typeGuard":null,"tryCatchPattern":"match history_branch(&bundle, &revision) {\n    Err(e) if e.to_string().contains(\"invalid transferred repository bundle\") => {\n        // re-fetch a fresh bundle once, then retry\n        re_fetch_bundle(origin)?;\n        history_branch(&bundle, &revision)\n    }\n    other => other,\n}","preventionTips":["Verify bundles with `git bundle verify` before consuming them","Avoid reusing cached bundle files across runs","Ensure transfers complete fully (stable network, sufficient disk)"],"tags":["git","corruption","bundle"],"backgroundTag":"git-command-failed","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}