{"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/533346cc374382b41ec5ff70536252b2e96e725c/src/system/remote_repository.rs#L131-L167","documentation":"history_branch clones a transferred repository bundle with `git clone --no-checkout` to inspect the .mise-history branch. If the clone from the bundle fails, the bundle is considered corrupt or not a valid git bundle, and this error is raised.","triggerScenarios":"Calling history_branch (or the code path consuming a bundle produced by Source::fetch) with a bundle path that is missing, truncated, not a git bundle, or created by an incompatible git version.","commonSituations":"Partial download of the bundle over an unreliable network; bundle cleaned up by a tmpfile sweeper mid-run; hand-editing or re-compressing the bundle file.","solutions":["Re-run the onboarding/fetch step so the bundle is regenerated from the source repository.","Verify the bundle with `git bundle verify <path>` to see the actual git error.","Check the file exists and has a plausible size before invoking the flow (disk full / partial transfer).","Upgrade git if the bundle uses features your git cannot parse."],"exampleFix":"// before (bundle truncated)\n$ git bundle verify /tmp/mise-xyz/repository.bundle\nfatal: unexpected end of file\n// after: refetch and retry\n$ rm /tmp/mise-xyz/repository.bundle && mise ... # regenerate bundle, then verify","handlingStrategy":"retry","validationCode":"// verify bundle before use\nspawnSync(\"git\", [\"bundle\", \"verify\", bundlePath]); // non-zero exit predicts this error","typeGuard":null,"tryCatchPattern":"match history_branch(&bundle, rev) {\n  Err(e) if e.to_string().contains(\"invalid transferred repository bundle\") => {\n    // regenerate bundle via Source::fetch and retry once\n  }\n  r => r,\n}","preventionTips":["Always `git bundle verify` a bundle before consuming it.","Re-download on size/hash mismatch instead of proceeding.","Avoid tmp cleaners that can delete bundles mid-run."],"tags":["git","bundle","corrupt-data","validation"],"backgroundTag":"git-command-failed","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}