jdx/mise · error

invalid transferred repository bundle

Error message

invalid transferred repository bundle

What it means

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.

Solutions

  1. Re-run the onboarding/fetch step so the bundle is regenerated from the source repository.
  2. Verify the bundle with `git bundle verify <path>` to see the actual git error.
  3. Check the file exists and has a plausible size before invoking the flow (disk full / partial transfer).
  4. Upgrade git if the bundle uses features your git cannot parse.

Example fix

// before (bundle truncated)
$ git bundle verify /tmp/mise-xyz/repository.bundle
fatal: unexpected end of file
// after: refetch and retry
$ rm /tmp/mise-xyz/repository.bundle && mise ... # regenerate bundle, then verify
Defensive patterns

Strategy: retry

Validate before calling

// verify bundle before use
spawnSync("git", ["bundle", "verify", bundlePath]); // non-zero exit predicts this error

Try / catch

match history_branch(&bundle, rev) {
  Err(e) if e.to_string().contains("invalid transferred repository bundle") => {
    // regenerate bundle via Source::fetch and retry once
  }
  r => r,
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "git command failed": what it means when a tool shells out to git and git exits non-zero — this error's family across 21 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/ff1e00b213c3dec5. Report an issue: GitHub.

Appendix: source

Thrown at src/system/remote_repository.rs:149

        .unwrap_or(*crate::dirs::CONFIG)
        .to_path_buf()
}

/// The branch of a transferred bundle whose tree carries the setup
/// repository marker (`.mise-history/format.toml`); `None` for an ordinary
/// repository.
pub(crate) fn history_branch(bundle: &Path, revision: &str) -> Result<Option<String>> {
    let temporary = tempfile::tempdir()?;
    let checkout = temporary.path().join("checkout");
    let mut command = Command::new("git");
    crate::git::sanitize_git_command(&mut command);
    let output = command
        .args(["clone", "--no-checkout", "--"])
        .arg(bundle)
        .arg(&checkout)
        .output()?;
    if !output.status.success() {
        bail!("invalid transferred repository bundle");
    }
    let marker = format!("{revision}:.mise-history/format.toml");
    if git(&checkout, &["cat-file", "-e", &marker]).is_err() {
        return Ok(None);
    }
    Ok(Some(git(&checkout, &["symbolic-ref", "--short", "HEAD"])?))
}

/// Installs the transferred revision as the global configuration checkout.
/// A dry run runs every check and says what it would do (clone, fast-forward,
/// adopt) without writing anything persistent.
pub(crate) fn install(
    bundle: &Path,
    origin: &str,
    revision: &str,
    update: bool,
    yes: bool,
    dry_run: bool,

View on GitHub (pinned to 533346cc37)