{"record":{"id":"cada209eee53d545","repo":"jdx/mise","slug":"failed-to-list-git-tracked-files-in","errorCode":null,"errorMessage":"failed to list Git-tracked files in {}: {}","messagePattern":"failed to list Git-tracked files in (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/files.rs","lineNumber":2177,"sourceCode":"        .arg(\"-C\")\n        .arg(source)\n        .arg(\"-c\")\n        .arg(safe)\n        .arg(\"-c\")\n        .arg(\"core.autocrlf=false\")\n        .args([\"ls-files\", \"-z\", \"--cached\", \"--stage\", \"--\", \".\"])\n        .stdout(std::process::Stdio::piped())\n        .stderr(std::process::Stdio::piped());\n    crate::git::sanitize_git_command(&mut command);\n    let output = command.output().wrap_err_with(|| {\n        format!(\n            \"failed to list Git-tracked files in {}\",\n            source.display_user()\n        )\n    })?;\n    if !output.status.success() {\n        let stderr = String::from_utf8_lossy(&output.stderr).trim().to_string();\n        bail!(\n            \"failed to list Git-tracked files in {}: {}\",\n            source.display_user(),\n            if stderr.is_empty() {\n                output.status.to_string()\n            } else {\n                stderr\n            }\n        );\n    }\n    output\n        .stdout\n        .split(|byte| *byte == 0)\n        .filter(|record| !record.is_empty())\n        .map(|record| {\n            let tab = record\n                .iter()\n                .position(|byte| *byte == b'\\t')\n                .ok_or_else(|| {","sourceCodeStart":2159,"sourceCodeEnd":2195,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/files.rs#L2159-L2195","documentation":"To enumerate the files a git-backed dotfile source manages, mise runs `git ls-files` (or equivalent) inside the source's repository. If the command exits non-zero, mise bails with this message carrying the source path and git's stderr (or the exit status when stderr is empty).","triggerScenarios":"Listing Git-tracked files for a dotfile source whose repository is broken: detached/corrupt index, bare repo without a work tree, permission problems, or a repo where `git ls-files` fails despite the root being locatable.","commonSituations":"Shallow or partially-cloned dotfiles repo with a corrupt index; running as a user without read access to the repo; repository locked by another git process; git version incompatibilities with an ancient repo format.","solutions":["Run `git status` / `git ls-files` manually in the source repo to see the underlying git error and fix it (e.g. `git reset` to rebuild the index).","Re-clone the dotfiles repository fresh.","Fix filesystem permissions on the repository directory for the user running mise."],"exampleFix":"# before (corrupt index)\n$ mise dotfiles apply  # fails\n# after\n$ cd ~/dotfiles && git reset  # rebuild index, then retry mise","handlingStrategy":"validation","validationCode":"let out = std::process::Command::new(\"git\")\n    .args([\"ls-files\"])\n    .current_dir(source)\n    .output()?;\nif !out.status.success() {\n    return Err(format!(\"git ls-files failed in {source:?}: {}\", String::from_utf8_lossy(&out.stderr)));\n}","typeGuard":null,"tryCatchPattern":"match dotfiles_apply() {\n    Err(e) if e.to_string().contains(\"failed to list Git-tracked files\") => {\n        eprintln!(\"repair the repo (git reset / re-clone): {e}\");\n    }\n    other => other?,\n}","preventionTips":["Run `git status` in the dotfiles repo when apply fails; repair a corrupt index with `git reset`.","Avoid concurrent git operations that lock the repository.","Re-clone rather than patching badly broken checkouts."],"tags":["dotfiles","git","filesystem","mise"],"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"}