{"record":{"id":"f1c0d16f9f5a4d1b","repo":"jdx/mise","slug":"repos-reason","errorCode":null,"errorMessage":"repos: {}: {reason}","messagePattern":"repos: (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/repos.rs","lineNumber":170,"sourceCode":"\npub(crate) async fn status(requests: &[RepoRequest]) -> Result<Vec<RepoStatus>> {\n    crate::parallel::parallel(requests.to_vec(), |request| async move {\n        tokio::task::spawn_blocking(move || status_one(&request)).await?\n    })\n    .await\n}\n\npub(crate) fn preflight_statuses(statuses: &[RepoStatus]) -> Result<()> {\n    for status in statuses {\n        match &status.state {\n            RepoState::Dirty => {\n                bail!(\n                    \"repos: {} has local changes; commit, stash, or clean them before bootstrap\",\n                    status.request\n                );\n            }\n            RepoState::Conflict(reason) => {\n                bail!(\"repos: {}: {reason}\", status.request);\n            }\n            RepoState::Current | RepoState::Missing | RepoState::Differs => {}\n        }\n    }\n    Ok(())\n}\n\n/// Apply statuses previously validated with [`preflight_statuses`].\npub(crate) fn apply_statuses(statuses: &[RepoStatus], dry_run: bool) -> Result<()> {\n    for status in statuses {\n        match &status.state {\n            RepoState::Current => {\n                info!(\"repos: {} already current\", status.request);\n            }\n            RepoState::Missing => clone_repo(&status.request, dry_run)?,\n            RepoState::Differs => update_repo(&status.request, dry_run)?,\n            RepoState::Dirty | RepoState::Conflict(_) => unreachable!(\"preflighted above\"),\n        }","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/repos.rs#L152-L188","documentation":"When repo status inspection yields RepoState::Conflict(reason), preflight_statuses aborts with `repos: <path>: <reason>`. Conflicts cover conditions where the checkout cannot be safely reconciled, e.g. the configured origin URL differs from the checkout's origin or a ref mismatch that preflight cannot auto-resolve. The embedded reason describes the specific conflict.","triggerScenarios":"Bootstrap detects a repo whose `origin` remote points at a different repository than the configured `url`, or other conflicting state surfaced by `status_one` as Conflict(reason).","commonSituations":"Reusing an existing directory (e.g. `~/src/dotfiles` from a different remote fork) for a new repo entry; re-pointing `url` in config after the checkout was cloned from the old remote; a non-git directory where a repo is expected.","solutions":["Update the checkout's remote to match config: `git -C <path> remote set-url origin <configured-url>`","Or update the config `url` to match the existing checkout's actual origin","Back up and delete the conflicting directory so bootstrap can re-clone from the configured url"],"exampleFix":"# before (origin mismatch)\nmise bootstrap  # repos: ~/src/dotfiles: origin ... does not match ...\n# after\ngit -C ~/src/dotfiles remote set-url origin https://github.com/jdx/dotfiles.git\nmise bootstrap","handlingStrategy":"validation","validationCode":"configured=$(git -C <repo-path> config --get remote.origin.url); echo \"origin: $configured\"  # compare with the url in mise.toml (transport-agnostically)","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"repos:\") && !e.to_string().contains(\"local changes\") => {\n        eprintln!(\"fix the origin/remote mismatch described: {e}\");\n    }\n    Err(e) => return Err(e),\n    Ok(v) => v,\n}","preventionTips":["Keep each checkout directory dedicated to a single remote; don't reuse directories across projects","When changing `url` in config, run `git remote set-url origin` on existing checkouts first","Ensure expected repo paths contain a git repo, not arbitrary content"],"tags":["git","remote-mismatch","bootstrap","state-conflict"],"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"}