{"record":{"id":"0e3cad5e88653a1c","repo":"GitoxideLabs/gitoxide","slug":"git-add-for-resolved-paths-failed-with","errorCode":null,"errorMessage":"git add for resolved paths failed with {}","messagePattern":"git add for resolved paths failed with (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"gix-tix/src/lib.rs","lineNumber":5642,"sourceCode":"    let workdir = repository\n        .workdir()\n        .context(\"cannot resolve a conflict without a worktree\")?;\n    let mut command = Command::new(\"git\");\n    command\n        .arg(\"--literal-pathspecs\")\n        .arg(\"-C\")\n        .arg(workdir)\n        .args([\"add\", \"-A\", \"--\"]);\n    for path in &paths {\n        command.arg(gix::path::from_bstr(path.as_bstr()).as_ref());\n    }\n    let output = command\n        .output()\n        .context(\"could not launch git add for resolved paths\")?;\n    if !output.status.success() {\n        let stderr = output.stderr.trim().to_str_lossy();\n        if stderr.is_empty() {\n            anyhow::bail!(\"git add for resolved paths failed with {}\", output.status);\n        }\n        anyhow::bail!(\"git add for resolved paths failed with {}: {stderr}\", output.status);\n    }\n\n    let index = repository\n        .open_index()\n        .context(\"could not verify the resolved conflict index\")?;\n    if index\n        .entries()\n        .iter()\n        .any(|entry| entry.stage() != gix::index::entry::Stage::Unconflicted)\n    {\n        anyhow::bail!(\"the conflict index still has unresolved entries\");\n    }\n    Ok(())\n}\n\nfn preview_todo_rebase_conflict(","sourceCodeStart":5624,"sourceCodeEnd":5660,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-tix/src/lib.rs#L5624-L5660","documentation":"An external `git add` invocation used to stage conflict-resolved paths exited with a non-zero status, and its stderr was empty, so only the exit status is reported. This relies on the git CLI as a subprocess to stage resolutions; failure means staging did not happen.","triggerScenarios":"Running the resolve/stage flow where the spawned `git add -- <paths>` process fails without writing anything to stderr (e.g. git not behaving, fatal error swallowed, signal).","commonSituations":"Mismatched git version in PATH; read-only index; git config hooks (pre-add hooks) failing silently; disk-full conditions producing no stderr output.","solutions":["Re-run with the captured ExitStatus inspected (`git add` manually on the same paths) to see the real cause.","Check that `git` in PATH is a compatible version and the repository index is writable.","Check for hooks or global config (core.hooksPath) interfering with `git add`.","Verify disk space and index.lock absence (.git/index.lock stale file)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"let ok = std::process::Command::new(\"git\").arg(\"--version\").output().map(|o| o.status.success()).unwrap_or(false);\nlet index_writable = !repo_git_dir.join(\"index.lock\").exists();","typeGuard":null,"tryCatchPattern":"match stage_resolved_paths(repo, &paths) {\n    Err(err) if err.to_string().starts_with(\"git add for resolved paths failed\") => {\n        eprintln!(\"git add failed; run it manually to diagnose\");\n    }\n    other => other?,\n}","preventionTips":["Verify a compatible git binary is in PATH before spawning.","Check for .git/index.lock before staging.","Capture and log stderr and exit status for every git subprocess."],"tags":["git","subprocess","staging","cli"],"backgroundTag":"git-command-failed","analyzedSha":"e73179060badf27222d790981fac3f84c1830a7e","analyzedAt":"2026-09-08T11:26:50.865Z","contentChangedAt":"2026-09-08T11:26:50.865Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}