{"record":{"id":"f6284fbe40175d10","repo":"jdx/mise","slug":"unresolved-git-index-entry-in","errorCode":null,"errorMessage":"unresolved Git index entry {} in {}","messagePattern":"unresolved Git index entry (.+?) in (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/files.rs","lineNumber":2204,"sourceCode":"    }\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(|| {\n                    eyre::eyre!(\n                        \"unexpected git ls-files output for {}\",\n                        source.display_user()\n                    )\n                })?;\n            let metadata = &record[..tab];\n            let path = path_buf_from_git_bytes(&record[tab + 1..]);\n            if !metadata.ends_with(b\" 0\") {\n                bail!(\n                    \"unresolved Git index entry {} in {}\",\n                    path.display(),\n                    source.display_user()\n                );\n            }\n            Ok(GitTrackedPath {\n                is_gitlink: metadata.starts_with(b\"160000 \"),\n                is_symlink: metadata.starts_with(b\"120000 \"),\n                path,\n            })\n        })\n        .collect()\n}\n\n/// Capture only the files selected by a Git manifest, preserving the source\n/// repository and any untracked files around them.\npub(crate) fn capture_git_manifest(req: &FileRequest) -> Result<()> {\n    for entry in git_tracked_paths(&req.source)? {","sourceCodeStart":2186,"sourceCodeEnd":2222,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/files.rs#L2186-L2222","documentation":"When reading the files managed by a Git-backed dotfiles source, mise runs `git ls-files --cached --stage` and validates each index record. A stage field ending in something other than `0` means the index holds an unmerged entry — i.e. an unresolved merge conflict — for that path. The library refuses to guess which side of the conflict is canonical, so it bails instead of capturing or syncing a half-resolved file.","triggerScenarios":"Running `mise dot` operations (apply/capture/track) on a source directory whose Git repository has an in-progress merge or cherry-pick with conflicted, still-unresolved paths — `git ls-files --stage` reports stage 1/2/3 entries for those files.","commonSituations":"The dotfiles repo was pulled and had conflicts the user never resolved; a rebase/cherry-pick was aborted half-way (`git status` still shows unmerged paths); a tool edited the index leaving stale conflict entries.","solutions":["Open the source repo, resolve the conflicted files, then `git add` them and commit or abort the merge (`git merge --abort` / `git rebase --abort`).","Verify with `git ls-files -u` in the source directory — it should print nothing.","Retry the mise dotfiles command once the index is clean."],"exampleFix":"// before: conflicted index\n$ git ls-files -u\n100644 <sha> 2\tzshrc\n// after: resolve + stage\n$ $EDITOR zshrc && git add zshrc && git commit\n$ git ls-files -u\n(empty) — rerun `mise dot apply`","handlingStrategy":"validation","validationCode":"if [ -n \"$(git -C ~/dotfiles ls-files -u)\" ]; then echo 'resolve merge conflicts in dotfiles repo first'; exit 1; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Resolve and commit (or abort) any merge/rebase in the dotfiles repo before running mise dot commands.","Keep `git status` clean in the source repo as part of your workflow.","Check `git ls-files -u` output is empty in CI before applying dotfiles."],"tags":["git","merge-conflict","dotfiles"],"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"}